added _.keys definition

This commit is contained in:
Brian Zengel
2013-10-20 17:10:29 -04:00
parent 9c3f7251d5
commit 234b8719a9
2 changed files with 11 additions and 7 deletions
+3 -1
View File
@@ -653,6 +653,8 @@ result = <boolean>_.isString('moe');
result = <boolean>_.isUndefined(void 0);
result = <string[]>_.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');
+8 -6
View File
@@ -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.