diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 4f459ba9ca..d7689f03e7 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -126,6 +126,9 @@ result = _.last(foodsType, { 'type': 'vegetable' }); result = _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); result = _.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 //////////////////////////////////////////////////////////////////////////////////////// diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 8759668223..d7cfdba956 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -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( + keys: List, + values: List): TResult; + + /** + * @see _.zipObject **/ export function object( keys: List,