Skip to content

Commit a301b36

Browse files
committed
lodash: signatures of _.findKey have been changed
1 parent ba424f7 commit a301b36

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

lodash/lodash-tests.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6008,10 +6008,9 @@ module TestExtend {
60086008

60096009
// _.findKey
60106010
module TestFindKey {
6011-
let result: string;
6012-
60136011
{
60146012
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
6013+
let result: string;
60156014

60166015
result = _.findKey<{a: string;}>({a: ''});
60176016

@@ -6038,13 +6037,38 @@ module TestFindKey {
60386037

60396038
{
60406039
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
6040+
let result: string;
60416041

60426042
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn);
60436043
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn, any);
60446044

60456045
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn);
60466046
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn, any);
60476047
}
6048+
6049+
{
6050+
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
6051+
let result: _.LoDashExplicitWrapper<string>;
6052+
6053+
result = _<{a: string;}>({a: ''}).chain().findKey();
6054+
6055+
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn);
6056+
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any);
6057+
6058+
6059+
result = _<{a: string;}>({a: ''}).chain().findKey('');
6060+
result = _<{a: string;}>({a: ''}).chain().findKey('', any);
6061+
6062+
result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42});
6063+
}
6064+
6065+
{
6066+
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
6067+
let result: _.LoDashExplicitWrapper<string>;
6068+
6069+
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn);
6070+
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn, any);
6071+
}
60486072
}
60496073

60506074
// _.findLastKey

lodash/lodash.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10396,6 +10396,39 @@ declare module _ {
1039610396
): string;
1039710397
}
1039810398

10399+
interface LoDashExplicitObjectWrapper<T> {
10400+
/**
10401+
* @see _.findKey
10402+
*/
10403+
findKey<TValues>(
10404+
predicate?: DictionaryIterator<TValues, boolean>,
10405+
thisArg?: any
10406+
): LoDashExplicitWrapper<string>;
10407+
10408+
/**
10409+
* @see _.findKey
10410+
*/
10411+
findKey(
10412+
predicate?: ObjectIterator<any, boolean>,
10413+
thisArg?: any
10414+
): LoDashExplicitWrapper<string>;
10415+
10416+
/**
10417+
* @see _.findKey
10418+
*/
10419+
findKey(
10420+
predicate?: string,
10421+
thisArg?: any
10422+
): LoDashExplicitWrapper<string>;
10423+
10424+
/**
10425+
* @see _.findKey
10426+
*/
10427+
findKey<TWhere extends Dictionary<any>>(
10428+
predicate?: TWhere
10429+
): LoDashExplicitWrapper<string>;
10430+
}
10431+
1039910432
//_.findLastKey
1040010433
interface LoDashStatic {
1040110434
/**

0 commit comments

Comments
 (0)