From 234b8719a91238d18a339b7b60c7bba91256b373 Mon Sep 17 00:00:00 2001 From: Brian Zengel Date: Sun, 20 Oct 2013 17:10:29 -0400 Subject: [PATCH] added _.keys definition --- lodash/lodash-tests.ts | 4 +++- lodash/lodash.d.ts | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d7df716bd..61854aee3 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -653,6 +653,8 @@ result = _.isString('moe'); result = _.isUndefined(void 0); +result = _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + var mergeNames = { 'stooges': [ { 'name': 'moe' }, @@ -696,7 +698,7 @@ _.merge(mergeFood, mergeOtherFood, function(a, b) { -_.keys({ one: 1, two: 2, three: 3 }); + _.values({ one: 1, two: 2, three: 3 }); _.pairs({ one: 1, two: 2, three: 3 }); _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 07ba90a54..68037960c 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2495,6 +2495,13 @@ declare module _ { **/ export function isUndefined(value: any): boolean; + /** + * Creates an array composed of the own enumerable property names of an object. + * @param object The object to inspect. + * @return An array of property names. + **/ + export function keys(object: any): string[]; + /** * Recursively merges own enumerable properties of the source object(s), that don't resolve * to undefined into the destination object. Subsequent sources will overwrite property @@ -2650,12 +2657,7 @@ declare module _ { * Objects * ***********/ - /** - * Retrieve all the names of the object's properties. - * @param object Retreive the key or property names from this object. - * @return List of all the property names on `object`. - **/ - export function keys(object: any): string[]; + /** * Return all of the values of the object's properties.