mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6910 from chrootsu/lodash-findKey
lodash: signatures of _.findKey have been changed
This commit is contained in:
+26
-2
@@ -6035,10 +6035,9 @@ module TestExtend {
|
||||
|
||||
// _.findKey
|
||||
module TestFindKey {
|
||||
let result: string;
|
||||
|
||||
{
|
||||
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
|
||||
let result: string;
|
||||
|
||||
result = _.findKey<{a: string;}>({a: ''});
|
||||
|
||||
@@ -6065,6 +6064,7 @@ module TestFindKey {
|
||||
|
||||
{
|
||||
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
|
||||
let result: string;
|
||||
|
||||
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn);
|
||||
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn, any);
|
||||
@@ -6072,6 +6072,30 @@ module TestFindKey {
|
||||
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn, any);
|
||||
}
|
||||
|
||||
{
|
||||
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey();
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any);
|
||||
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey('');
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey('', any);
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn, any);
|
||||
}
|
||||
}
|
||||
|
||||
// _.findLastKey
|
||||
|
||||
Vendored
+33
@@ -10412,6 +10412,39 @@ declare module _ {
|
||||
): string;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey<TValues>(
|
||||
predicate?: DictionaryIterator<TValues, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey(
|
||||
predicate?: ObjectIterator<any, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey<TWhere extends Dictionary<any>>(
|
||||
predicate?: TWhere
|
||||
): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
//_.findLastKey
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user