mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-24 11:50:59 +08:00
added _.pairs definition
This commit is contained in:
1 parent
d6c880cc48
commit
d7b332ac7c
2 files changed
+12
-6
No files matched your search
@@ -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