mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 19:50:08 +00:00
definitions for _.zipObject and alias _.object
This commit is contained in:
@@ -126,6 +126,9 @@ result = <IFoodType[]>_.last(foodsType, { 'type': 'vegetable' });
|
||||
result = <number>_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
|
||||
result = <number>_.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3);
|
||||
|
||||
result = <{[key: string]: any}>_.zipObject(['moe', 'larry'], [30, 40]);
|
||||
result = <{[key: string]: any}>_.object(['moe', 'larry'], [30, 40]);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
//WHAT'S LEFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
18
lodash/lodash.d.ts
vendored
18
lodash/lodash.d.ts
vendored
@@ -1005,11 +1005,19 @@ declare module _ {
|
||||
export function zip(...arrays: any[]): any[];
|
||||
|
||||
/**
|
||||
* Converts arrays into objects. Pass either a single list of [key, value] pairs, or a
|
||||
* list of keys, and a list of values.
|
||||
* @param keys Key array.
|
||||
* @param values Value array.
|
||||
* @return An object containing the `keys` as properties and `values` as the property values.
|
||||
* Creates an object composed from arrays of keys and values. Provide either a single
|
||||
* two dimensional array, i.e. [[key1, value1], [key2, value2]] or two arrays, one of
|
||||
* keys and one of corresponding values.
|
||||
* @param keys The array of keys.
|
||||
* @param values The array of values.
|
||||
* @return An object composed of the given keys and corresponding values.
|
||||
**/
|
||||
export function zipObject<TResult extends {}>(
|
||||
keys: List<string>,
|
||||
values: List<any>): TResult;
|
||||
|
||||
/**
|
||||
* @see _.zipObject
|
||||
**/
|
||||
export function object<TResult extends {}>(
|
||||
keys: List<string>,
|
||||
|
||||
Reference in New Issue
Block a user