lodash: fix toPairs, toPairsIn definitions

toPairs:   https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L13684:L13708
toPairsIn: https://github.com/lodash/lodash/blob/4.17.4/lodash.js#L13710:L13734

Fixes #14654.
This commit is contained in:
Tamir Duberstein
2017-03-24 13:53:25 -04:00
parent bb7d6b2d08
commit 701ad3fcc0
2 changed files with 20 additions and 20 deletions

View File

@@ -16993,23 +16993,23 @@ declare namespace _ {
* @param object The object to query.
* @return Returns the new array of key-value pairs.
*/
toPairs<T extends {}>(object?: T): any[][];
toPairs<T extends {}>(object?: T): [string, any][];
toPairs<T extends {}, TResult>(object?: T): TResult[][];
toPairs<T extends {}, TResult>(object?: T): [string, TResult][];
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.toPairs
*/
toPairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
toPairs<TResult>(): LoDashImplicitArrayWrapper<[string, TResult]>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.toPairs
*/
toPairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
toPairs<TResult>(): LoDashExplicitArrayWrapper<[string, TResult]>;
}
//_.toPairsIn
@@ -17020,23 +17020,23 @@ declare namespace _ {
* @param object The object to query.
* @return Returns the new array of key-value pairs.
*/
toPairsIn<T extends {}>(object?: T): any[][];
toPairsIn<T extends {}>(object?: T): [string, any][];
toPairsIn<T extends {}, TResult>(object?: T): TResult[][];
toPairsIn<T extends {}, TResult>(object?: T): [string, TResult][];
}
interface LoDashImplicitObjectWrapper<T> {
/**
* @see _.toPairsIn
*/
toPairsIn<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
toPairsIn<TResult>(): LoDashImplicitArrayWrapper<[string, TResult]>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.toPairsIn
*/
toPairsIn<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
toPairsIn<TResult>(): LoDashExplicitArrayWrapper<[string, TResult]>;
}
//_.transform

View File

@@ -10176,37 +10176,37 @@ namespace TestToPairs {
let object: _.Dictionary<string>;
{
let result: any[][];
let result: [string, any][];
result = _.toPairs<_.Dictionary<string>>(object);
}
{
let result: string[][];
let result: [string, string][];
result = _.toPairs<_.Dictionary<string>, string>(object);
}
{
let result: _.LoDashImplicitArrayWrapper<string[]>;
let result: _.LoDashImplicitArrayWrapper<[string, string]>;
result = _(object).toPairs<string>();
}
{
let result: _.LoDashImplicitArrayWrapper<any[]>;
let result: _.LoDashImplicitArrayWrapper<[string, any]>;
result = _(object).toPairs();
}
{
let result: _.LoDashExplicitArrayWrapper<string[]>;
let result: _.LoDashExplicitArrayWrapper<[string, string]>;
result = _(object).chain().toPairs<string>();
}
{
let result: _.LoDashExplicitArrayWrapper<any[]>;
let result: _.LoDashExplicitArrayWrapper<[string, any]>;
result = _(object).chain().toPairs();
}
@@ -10217,37 +10217,37 @@ namespace TestToPairsIn {
let object: _.Dictionary<string>;
{
let result: any[][];
let result: [string, any][];
result = _.toPairsIn<_.Dictionary<string>>(object);
}
{
let result: string[][];
let result: [string, string][];
result = _.toPairsIn<_.Dictionary<string>, string>(object);
}
{
let result: _.LoDashImplicitArrayWrapper<string[]>;
let result: _.LoDashImplicitArrayWrapper<[string, string]>;
result = _(object).toPairsIn<string>();
}
{
let result: _.LoDashImplicitArrayWrapper<any[]>;
let result: _.LoDashImplicitArrayWrapper<[string, any]>;
result = _(object).toPairsIn();
}
{
let result: _.LoDashExplicitArrayWrapper<string[]>;
let result: _.LoDashExplicitArrayWrapper<[string, string]>;
result = _(object).chain().toPairsIn<string>();
}
{
let result: _.LoDashExplicitArrayWrapper<any[]>;
let result: _.LoDashExplicitArrayWrapper<[string, any]>;
result = _(object).chain().toPairs();
}