Merge pull request #6963 from chrootsu/lodash-findLastKey

lodash: signatures of _.findLastKey have been changed
This commit is contained in:
Masahiro Wakame
2015-12-01 22:56:46 +09:00
2 changed files with 59 additions and 2 deletions
+26 -2
View File
@@ -6184,10 +6184,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: ''});
@@ -6214,6 +6213,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);
@@ -6221,6 +6221,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
@@ -10620,6 +10620,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 {
/**