lodash: signatures of _.findLastKey have been changed

This commit is contained in:
Ilya Mochalov
2015-11-27 05:47:07 +05:00
parent fb2b3b1e06
commit 06869f8867
2 changed files with 59 additions and 2 deletions
+26 -2
View File
@@ -6117,10 +6117,9 @@ module TestFindKey {
// _.findLastKey
module TestFindLastKey {
let result: string;
{
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
let result: string;
result = _.findLastKey<{a: string;}>({a: ''});
@@ -6147,6 +6146,7 @@ module TestFindLastKey {
{
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
let result: string;
result = _.findLastKey<string, {a: string;}>({a: ''}, predicateFn);
result = _.findLastKey<string, {a: string;}>({a: ''}, predicateFn, any);
@@ -6154,6 +6154,30 @@ module TestFindLastKey {
result = _<{a: string;}>({a: ''}).findLastKey<string>(predicateFn);
result = _<{a: string;}>({a: ''}).findLastKey<string>(predicateFn, any);
}
{
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
let result: _.LoDashExplicitWrapper<string>;
result = _<{a: string;}>({a: ''}).chain().findLastKey();
result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn);
result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any);
result = _<{a: string;}>({a: ''}).chain().findLastKey('');
result = _<{a: string;}>({a: ''}).chain().findLastKey('', any);
result = _<{a: string;}>({a: ''}).chain().findLastKey<{a: number;}>({a: 42});
}
{
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
let result: _.LoDashExplicitWrapper<string>;
result = _<{a: string;}>({a: ''}).chain().findLastKey<string>(predicateFn);
result = _<{a: string;}>({a: ''}).chain().findLastKey<string>(predicateFn, any);
}
}
// _.forIn
+33
View File
@@ -10544,6 +10544,39 @@ declare module _ {
): string;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.findLastKey
*/
findLastKey<TValues>(
predicate?: DictionaryIterator<TValues, boolean>,
thisArg?: any
): LoDashExplicitWrapper<string>;
/**
* @see _.findLastKey
*/
findLastKey(
predicate?: ObjectIterator<any, boolean>,
thisArg?: any
): LoDashExplicitWrapper<string>;
/**
* @see _.findLastKey
*/
findLastKey(
predicate?: string,
thisArg?: any
): LoDashExplicitWrapper<string>;
/**
* @see _.findLastKey
*/
findLastKey<TWhere extends Dictionary<any>>(
predicate?: TWhere
): LoDashExplicitWrapper<string>;
}
//_.forIn
interface LoDashStatic {
/**