mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-29 11:12:23 +08:00
lodash: signatures of the method _.pairs have been changed
This commit is contained in:
+40
-2
@@ -5458,8 +5458,46 @@ result = <HasName>_({ 'name': 'moe', 'age': 40 }).omit(function (value) {
|
||||
return typeof value == 'number';
|
||||
}).value();
|
||||
|
||||
result = <any[][]>_.pairs({ 'moe': 30, 'larry': 40 });
|
||||
result = <any[][]>_({ 'moe': 30, 'larry': 40 }).pairs().value();
|
||||
// _.pairs
|
||||
module TestPairs {
|
||||
let object: _.Dictionary<string>;
|
||||
|
||||
{
|
||||
let result: any[][];
|
||||
|
||||
result = _.pairs<_.Dictionary<string>>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: string[][];
|
||||
|
||||
result = _.pairs<_.Dictionary<string>, string>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).pairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).pairs();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).chain().pairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).chain().pairs();
|
||||
}
|
||||
}
|
||||
|
||||
// _.pick
|
||||
interface TestPickFn {
|
||||
|
||||
Vendored
+18
-9
@@ -10518,19 +10518,28 @@ declare module _ {
|
||||
//_.pairs
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
pairs(object?: any): any[][];
|
||||
* Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]].
|
||||
*
|
||||
* @param object The object to query.
|
||||
* @return Returns the new array of key-value pairs.
|
||||
*/
|
||||
pairs<T extends {}>(object?: T): any[][];
|
||||
|
||||
pairs<T extends {}, TResult>(object?: T): TResult[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.pairs
|
||||
**/
|
||||
pairs(): LoDashImplicitArrayWrapper<any[]>;
|
||||
* @see _.pairs
|
||||
*/
|
||||
pairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.pairs
|
||||
*/
|
||||
pairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
//_.pick
|
||||
|
||||
Reference in New Issue
Block a user