mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.pairs definition
This commit is contained in:
@@ -691,6 +691,8 @@ result = <any>_.omit({ 'name': 'moe', 'age': 40 }, function(value) {
|
||||
return typeof value == 'number';
|
||||
});
|
||||
|
||||
result = <any[][]>_.pairs({ 'moe': 30, 'larry': 40 });
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
//WHAT'S LEFT
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+10
-6
@@ -2641,6 +2641,15 @@ declare module _ {
|
||||
callback: (value: any) => boolean,
|
||||
thisArg?: any): any;
|
||||
|
||||
/**
|
||||
* Creates a two dimensional array of an object’s key-value pairs,
|
||||
* i.e. [[key1, value1], [key2, value2]].
|
||||
* @param object The object to inspect.
|
||||
* @return Aew array of key-value pairs.
|
||||
**/
|
||||
export function pairs(object: any): any[][];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2691,12 +2700,7 @@ declare module _ {
|
||||
**/
|
||||
export function values(object: any): any[];
|
||||
|
||||
/**
|
||||
* Convert an object into a list of [key, value] pairs.
|
||||
* @param object Convert this object to a list of [key, value] pairs.
|
||||
* @return List of [key, value] pairs on `object`.
|
||||
**/
|
||||
export function pairs(object: any): any[][];
|
||||
|
||||
|
||||
/**
|
||||
* Return a copy of the object, filtered to only have values for the whitelisted keys
|
||||
|
||||
Reference in New Issue
Block a user