mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.keys definition
This commit is contained in:
@@ -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');
|
||||
|
||||
Vendored
+8
-6
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user