From 057754cfd31cf552d2617769667109a7441761ca Mon Sep 17 00:00:00 2001 From: aj-r Date: Sat, 23 Dec 2017 12:34:07 -0500 Subject: [PATCH 1/7] lodash: _.get should with numeric keys, too. Also added some better tests. --- types/lodash/index.d.ts | 51 ++++++++++++++++++++++++++++++++++++ types/lodash/lodash-tests.ts | 20 ++++++++++++-- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index caa92006b8..cc90e15559 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -13372,6 +13372,23 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + object: NumericDictionary | null | undefined, + path: number, + defaultValue: TDefault + ): T | TDefault; + /** * @see _.get */ @@ -13424,6 +13441,23 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number + ): T | undefined; + + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): T | TDefault; + /** * @see _.get */ @@ -13475,6 +13509,23 @@ declare namespace _ { defaultValue: TDefault ): LoDashExplicitWrapper; + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number + ): LoDashExplicitWrapper; + + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitWrapper; + /** * @see _.get */ diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 774e58ef9f..fe1f1eb9ca 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,6 +11266,22 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); + _.get('abc', 4); // $ExpectType string | undefined + _('abc').get(4); // $ExpectType string | undefined + _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + + _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } + _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } + _.chain({ a: { b: true } }).get("a"); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> + + _.get({ a: { b: true } }, ["a"]); // $ExpectType { b: boolean; } + _({ a: { b: true } }).get(["a"]); // $ExpectType { b: boolean; } + _.chain({ a: { b: true } }).get(["a"]); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> + + _.get({ a: { b: true } }, ["a", "b"]); // $ExpectType any + _({ a: { b: true } }).get(["a", "b"]); // $ExpectType any + _.chain({ a: { b: true } }).get(["a", "b"]); // $ExpectType LoDashExplicitWrapper + { let result: string; @@ -11322,7 +11338,7 @@ namespace TestGet { result = _({a: true}).get(['a']); result = _({a: true}).get(['a'], false); } - +/* { let result: _.LoDashExplicitWrapper; @@ -11348,7 +11364,7 @@ namespace TestGet { result = _({a: true}).chain().get('a', false); result = _({a: true}).chain().get(['a']); result = _({a: true}).chain().get(['a'], false); - } + }*/ } // _.has From 6e0532c130119f75734ccb934baf22974b889749 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Tue, 2 Jan 2018 09:06:13 -0500 Subject: [PATCH 2/7] lodash: add one more NumericDictionary overload for _.get --- types/lodash/index.d.ts | 24 ++++++++++++++++++++++++ types/lodash/lodash-tests.ts | 10 +++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index cc90e15559..00a1cd63b2 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -13372,6 +13372,14 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + object: NumericDictionary, + path: number + ): T; + /** * @see _.get */ @@ -13441,6 +13449,14 @@ declare namespace _ { defaultValue: TDefault ): TObject[TKey] | TDefault; + /** + * @see _.get + */ + get( + this: LoDashImplicitWrapper>, + path: number + ): T; + /** * @see _.get */ @@ -13509,6 +13525,14 @@ declare namespace _ { defaultValue: TDefault ): LoDashExplicitWrapper; + /** + * @see _.get + */ + get( + this: LoDashExplicitWrapper>, + path: number + ): LoDashExplicitWrapper; + /** * @see _.get */ diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index fe1f1eb9ca..d3886537a1 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,9 +11266,9 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); - _.get('abc', 4); // $ExpectType string | undefined - _('abc').get(4); // $ExpectType string | undefined - _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + _.get('abc', 4); // $ExpectType string + _('abc').get(4); // $ExpectType string + _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } @@ -11338,7 +11338,7 @@ namespace TestGet { result = _({a: true}).get(['a']); result = _({a: true}).get(['a'], false); } -/* + { let result: _.LoDashExplicitWrapper; @@ -11364,7 +11364,7 @@ namespace TestGet { result = _({a: true}).chain().get('a', false); result = _({a: true}).chain().get(['a']); result = _({a: true}).chain().get(['a'], false); - }*/ + } } // _.has From 5b606cac973d358d6c5141fea915a03b124b16d3 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Wed, 3 Jan 2018 18:46:29 -0500 Subject: [PATCH 3/7] lodash: more reasonable index for _.get tests --- types/lodash/lodash-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index d3886537a1..69fe88b341 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -11266,9 +11266,9 @@ namespace TestGet { _.get([], Symbol.iterator); _.get([], [Symbol.iterator]); - _.get('abc', 4); // $ExpectType string - _('abc').get(4); // $ExpectType string - _.chain('abc').get(4); // $ExpectType LoDashExplicitWrapper + _.get('abc', 1); // $ExpectType string + _('abc').get(1); // $ExpectType string + _.chain('abc').get(1); // $ExpectType LoDashExplicitWrapper _.get({ a: { b: true } }, "a"); // $ExpectType { b: boolean; } _({ a: { b: true } }).get("a"); // $ExpectType { b: boolean; } From 1e7f4242377340083bb988f6cbc58869b603d44a Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Thu, 3 May 2018 21:22:50 -0400 Subject: [PATCH 4/7] lodash: improve omit/unset/mergeAll (#25361,#25365,#25382), fix partial --- types/lodash/common/common.d.ts | 3 + types/lodash/common/object.d.ts | 36 ++- types/lodash/fp.d.ts | 329 +++++++++++++++++++++++++--- types/lodash/lodash-tests.ts | 36 +-- types/lodash/scripts/generate-fp.ts | 35 ++- types/lowdb/_lodash.d.ts | 20 +- 6 files changed, 392 insertions(+), 67 deletions(-) diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index 28c4437073..b5da2a8080 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -217,6 +217,9 @@ declare module "../index" { type PropertyName = string | number | symbol; type PropertyPath = Many; + type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; + type Omit = Pick>; + /** Common interface between Arrays and jQuery objects */ type List = ArrayLike; diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index e0b1f3ebf1..5e2d539c23 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -2860,15 +2860,23 @@ declare module "../index" { */ omit( object: T | null | undefined, - ...paths: PropertyPath[] + ...paths: Array> ): T; + /** + * @see _.omit + */ + omit( + object: T | null | undefined, + ...paths: Array> + ): Omit; + /** * @see _.omit */ omit( object: T | null | undefined, - ...paths: PropertyPath[] + ...paths: Array> ): PartialObject; } @@ -2878,15 +2886,23 @@ declare module "../index" { */ omit( this: LoDashImplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashImplicitWrapper; + /** + * @see _.omit + */ + omit( + this: LoDashImplicitWrapper, + ...paths: Array> + ): LoDashImplicitWrapper>; + /** * @see _.omit */ omit( this: LoDashImplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashImplicitWrapper>; } @@ -2896,15 +2912,23 @@ declare module "../index" { */ omit( this: LoDashExplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashExplicitWrapper; + /** + * @see _.omit + */ + omit( + this: LoDashExplicitWrapper, + ...paths: Array> + ): LoDashExplicitWrapper>; + /** * @see _.omit */ omit( this: LoDashExplicitWrapper, - ...paths: PropertyPath[] + ...paths: Array> ): LoDashExplicitWrapper>; } diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index d577414aa4..da68ea250e 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -1,6 +1,6 @@ // AUTO-GENERATED: do not modify this file directly. // If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do: -// npm run fp +// npm install && npm run generate import lodash = require("./index"); @@ -60,7 +60,14 @@ declare namespace _ { } type LodashAssign1x1 = (source: TSource) => TObject & TSource; type LodashAssign1x2 = (object: TObject) => TObject & TSource; - type LodashAssignAll = (object: ReadonlyArray) => any; + interface LodashAssignAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): any; + } interface LodashAssignAllWith { (customizer: lodash.AssignCustomizer): LodashAssignAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashAssignAllWith1x2; @@ -75,7 +82,14 @@ declare namespace _ { } type LodashAssignIn1x1 = (source: TSource) => TObject & TSource; type LodashAssignIn1x2 = (object: TObject) => TObject & TSource; - type LodashAssignInAll = (object: ReadonlyArray) => TResult; + interface LodashAssignInAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): TResult; + } interface LodashAssignInAllWith { (customizer: lodash.AssignCustomizer): LodashAssignInAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashAssignInAllWith1x2; @@ -453,7 +467,14 @@ declare namespace _ { } type LodashDefaults1x1 = (object: TObject) => TSource & TObject; type LodashDefaults1x2 = (source: TSource) => TSource & TObject; - type LodashDefaultsAll = (object: ReadonlyArray) => any; + interface LodashDefaultsAll { + (object: [TObject, TSource]): TSource & TObject; + (object: [TObject, TSource1, TSource2]): TSource2 & TSource1 & TObject; + (object: [TObject, TSource1, TSource2, TSource3]): TSource3 & TSource2 & TSource1 & TObject; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TSource4 & TSource3 & TSource2 & TSource1 & TObject; + (object: [TObject]): TObject; + (object: ReadonlyArray): any; + } interface LodashDefaultsDeep { (sources: any): LodashDefaultsDeep1x1; (sources: lodash.__, object: any): LodashDefaultsDeep1x2; @@ -546,11 +567,11 @@ declare namespace _ { type LodashDifferenceWith1x6 = (comparator: lodash.Comparator2) => T1[]; interface LodashUnset { (path: lodash.PropertyPath): LodashUnset1x1; - (path: lodash.__, object: any): LodashUnset1x2; - (path: lodash.PropertyPath, object: any): boolean; + (path: lodash.__, object: T): LodashUnset1x2; + (path: lodash.PropertyPath, object: T): T; } - type LodashUnset1x1 = (object: any) => boolean; - type LodashUnset1x2 = (path: lodash.PropertyPath) => boolean; + type LodashUnset1x1 = (object: T) => T; + type LodashUnset1x2 = (path: lodash.PropertyPath) => T; interface LodashDivide { (dividend: number): LodashDivide1x1; (dividend: lodash.__, divisor: number): LodashDivide1x2; @@ -704,7 +725,14 @@ declare namespace _ { } type LodashExtend1x1 = (source: TSource) => TObject & TSource; type LodashExtend1x2 = (object: TObject) => TObject & TSource; - type LodashExtendAll = (object: ReadonlyArray) => TResult; + interface LodashExtendAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: [TObject]): TObject; + (object: ReadonlyArray): TResult; + } interface LodashExtendAllWith { (customizer: lodash.AssignCustomizer): LodashExtendAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashExtendAllWith1x2; @@ -2171,7 +2199,13 @@ declare namespace _ { } type LodashMerge1x1 = (source: TSource) => TObject & TSource; type LodashMerge1x2 = (object: TObject) => TObject & TSource; - type LodashMergeAll = (object: ReadonlyArray) => any; + interface LodashMergeAll { + (object: [TObject, TSource]): TObject & TSource; + (object: [TObject, TSource1, TSource2]): TObject & TSource1 & TSource2; + (object: [TObject, TSource1, TSource2, TSource3]): TObject & TSource1 & TSource2 & TSource3; + (object: [TObject, TSource1, TSource2, TSource3, TSource4]): TObject & TSource1 & TSource2 & TSource3 & TSource4; + (object: ReadonlyArray): any; + } interface LodashMergeAllWith { (customizer: lodash.MergeWithCustomizer): LodashMergeAllWith1x1; (customizer: lodash.__, args: ReadonlyArray): LodashMergeAllWith1x2; @@ -2235,18 +2269,24 @@ declare namespace _ { type LodashNth1x2 = (n: number) => T | undefined; type LodashNthArg = (n: number) => (...args: any[]) => any; interface LodashOmit { - (paths: lodash.PropertyPath): LodashOmit1x1; + (paths: lodash.Many): LodashOmit1x1; (paths: lodash.__, object: T | null | undefined): LodashOmit1x2; - (paths: lodash.PropertyPath, object: T | null | undefined): T; + (paths: lodash.Many, object: T | null | undefined): T; + (paths: lodash.Many): LodashOmit2x1; (paths: lodash.__, object: T | null | undefined): LodashOmit2x2; - (paths: lodash.PropertyPath, object: T | null | undefined): lodash.PartialObject; + (paths: lodash.Many, object: T | null | undefined): lodash.Omit; + (paths: lodash.Many, object: T | null | undefined): lodash.PartialObject; } interface LodashOmit1x1 { (object: T | null | undefined): T; (object: T | null | undefined): lodash.PartialObject; } - type LodashOmit1x2 = (paths: lodash.PropertyPath) => T; - type LodashOmit2x2 = (paths: lodash.PropertyPath) => lodash.PartialObject; + type LodashOmit1x2 = (paths: lodash.Many) => T; + type LodashOmit2x1 = (object: T | null | undefined) => lodash.Omit; + interface LodashOmit2x2 { + (paths: lodash.Many): lodash.Omit; + (paths: lodash.Many): lodash.PartialObject; + } interface LodashOmitBy { (predicate: lodash.ValueKeyIteratee): LodashOmitBy1x1; (predicate: lodash.__, object: T | null | undefined): LodashOmitBy1x2; @@ -2435,21 +2475,252 @@ declare namespace _ { type LodashParseInt1x1 = (string: string) => number; type LodashParseInt1x2 = (radix: number) => number; interface LodashPartial { - (args: ReadonlyArray): LodashPartial1x1; - (args: lodash.__, func: (...args: any[]) => any): LodashPartial1x2; - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + (func: lodash.Function1): LodashPartial1x1; + (func: lodash.__, arg1: [T1]): LodashPartial1x2; + (func: lodash.Function1, arg1: [T1]): lodash.Function0; + (func: lodash.Function2): LodashPartial2x1; + (func: lodash.Function2, arg1: [T1]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2]): LodashPartial3x2; + (func: lodash.Function2, plc1: [lodash.__, T2]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2]): LodashPartial4x2; + (func: lodash.Function2, arg1: [T1, T2]): lodash.Function0< R>; + (func: lodash.Function3): LodashPartial5x1; + (func: lodash.Function3, arg1: [T1]): lodash.Function2< T2, T3, R>; + (func: lodash.Function3, plc1: [lodash.__, T2]): lodash.Function2; + (func: lodash.Function3, arg1: [T1, T2]): lodash.Function1< T3, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, T3]): LodashPartial8x2; + (func: lodash.Function3, plc1: [lodash.__, lodash.__, T3]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3]): LodashPartial9x2; + (func: lodash.Function3, arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2, T3]): LodashPartial10x2; + (func: lodash.Function3, plc1: [lodash.__, T2, T3]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3]): LodashPartial11x2; + (func: lodash.Function3, arg1: [T1, T2, T3]): lodash.Function0< R>; + (func: lodash.Function4): LodashPartial12x1; + (func: lodash.Function4, arg1: [T1]): lodash.Function3< T2, T3, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, T2]): lodash.Function3; + (func: lodash.Function4, arg1: [T1, T2]): lodash.Function2< T3, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, T3]): lodash.Function3; + (func: lodash.Function4, arg1: [T1, lodash.__, T3]): lodash.Function2< T2, T4, R>; + (func: lodash.Function4, plc1: [lodash.__, T2, T3]): lodash.Function2; + (func: lodash.Function4, arg1: [T1, T2, T3]): lodash.Function1< T4, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, lodash.__, T4]): LodashPartial19x2; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, lodash.__, T4]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, T4]): LodashPartial20x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (func: lodash.__, plc1: [lodash.__, T2, lodash.__, T4]): LodashPartial21x2; + (func: lodash.Function4, plc1: [lodash.__, T2, lodash.__, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__, T4]): LodashPartial22x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (func: lodash.__, plc1: [lodash.__, lodash.__, T3, T4]): LodashPartial23x2; + (func: lodash.Function4, plc1: [lodash.__, lodash.__, T3, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3, T4]): LodashPartial24x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (func: lodash.__, plc1: [lodash.__, T2, T3, T4]): LodashPartial25x2; + (func: lodash.Function4, plc1: [lodash.__, T2, T3, T4]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3, T4]): LodashPartial26x2; + (func: lodash.Function4, arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + (func: (...args: any[]) => any): LodashPartial27x1; + (func: lodash.__, args: ReadonlyArray): LodashPartial27x2; + (func: (...args: any[]) => any, args: ReadonlyArray): (...args: any[]) => any; placeholder: lodash.__; } - type LodashPartial1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; - type LodashPartial1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartial1x1 = (arg1: [T1]) => lodash.Function0; + interface LodashPartial1x2 { + (func: lodash.Function1): lodash.Function0; + (func: lodash.Function2): lodash.Function1< T2, R>; + (func: lodash.Function3): lodash.Function2< T2, T3, R>; + (func: lodash.Function4): lodash.Function3< T2, T3, T4, R>; + } + interface LodashPartial2x1 { + (arg1: [T1]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2]): lodash.Function1; + (arg1: [T1, T2]): lodash.Function0< R>; + } + interface LodashPartial3x2 { + (func: lodash.Function2): lodash.Function1; + (func: lodash.Function3): lodash.Function2; + (func: lodash.Function4): lodash.Function3; + } + interface LodashPartial4x2 { + (func: lodash.Function2): lodash.Function0< R>; + (func: lodash.Function3): lodash.Function1< T3, R>; + (func: lodash.Function4): lodash.Function2< T3, T4, R>; + } + interface LodashPartial5x1 { + (arg1: [T1]): lodash.Function2< T2, T3, R>; + (plc1: [lodash.__, T2]): lodash.Function2; + (arg1: [T1, T2]): lodash.Function1< T3, R>; + (plc1: [lodash.__, lodash.__, T3]): lodash.Function2; + (arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2, T3]): lodash.Function1; + (arg1: [T1, T2, T3]): lodash.Function0< R>; + } + interface LodashPartial8x2 { + (func: lodash.Function3): lodash.Function2; + (func: lodash.Function4): lodash.Function3; + } + interface LodashPartial9x2 { + (func: lodash.Function3): lodash.Function1< T2, R>; + (func: lodash.Function4): lodash.Function2< T2, T4, R>; + } + interface LodashPartial10x2 { + (func: lodash.Function3): lodash.Function1; + (func: lodash.Function4): lodash.Function2; + } + interface LodashPartial11x2 { + (func: lodash.Function3): lodash.Function0< R>; + (func: lodash.Function4): lodash.Function1< T4, R>; + } + interface LodashPartial12x1 { + (arg1: [T1]): lodash.Function3< T2, T3, T4, R>; + (plc1: [lodash.__, T2]): lodash.Function3; + (arg1: [T1, T2]): lodash.Function2< T3, T4, R>; + (plc1: [lodash.__, lodash.__, T3]): lodash.Function3; + (arg1: [T1, lodash.__, T3]): lodash.Function2< T2, T4, R>; + (plc1: [lodash.__, T2, T3]): lodash.Function2; + (arg1: [T1, T2, T3]): lodash.Function1< T4, R>; + (plc1: [lodash.__, lodash.__, lodash.__, T4]): lodash.Function3; + (arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (plc1: [lodash.__, T2, lodash.__, T4]): lodash.Function2; + (arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (plc1: [lodash.__, lodash.__, T3, T4]): lodash.Function2; + (arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (plc1: [lodash.__, T2, T3, T4]): lodash.Function1; + (arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + } + type LodashPartial19x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartial20x2 = (func: lodash.Function4) => lodash.Function2< T2, T3, R>; + type LodashPartial21x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartial22x2 = (func: lodash.Function4) => lodash.Function1< T3, R>; + type LodashPartial23x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartial24x2 = (func: lodash.Function4) => lodash.Function1< T2, R>; + type LodashPartial25x2 = (func: lodash.Function4) => lodash.Function1; + type LodashPartial26x2 = (func: lodash.Function4) => lodash.Function0< R>; + type LodashPartial27x1 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartial27x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; interface LodashPartialRight { - (args: ReadonlyArray): LodashPartialRight1x1; - (args: lodash.__, func: (...args: any[]) => any): LodashPartialRight1x2; - (args: ReadonlyArray, func: (...args: any[]) => any): (...args: any[]) => any; + (func: lodash.Function1): LodashPartialRight1x1; + (func: lodash.__, arg1: [T1]): LodashPartialRight1x2; + (func: lodash.Function1, arg1: [T1]): lodash.Function0; + (func: lodash.Function2): LodashPartialRight2x1; + (func: lodash.__, arg1: [T1, lodash.__]): LodashPartialRight2x2; + (func: lodash.Function2, arg1: [T1, lodash.__]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2]): LodashPartialRight3x2; + (func: lodash.Function2, arg2: [T2]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2]): LodashPartialRight4x2; + (func: lodash.Function2, arg1: [T1, T2]): lodash.Function0< R>; + (func: lodash.Function3): LodashPartialRight5x1; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__]): LodashPartialRight5x2; + (func: lodash.Function3, arg1: [T1, lodash.__, lodash.__]): lodash.Function2< T2, T3, R>; + (func: lodash.__, arg2: [T2, lodash.__]): LodashPartialRight6x2; + (func: lodash.Function3, arg2: [T2, lodash.__]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__]): LodashPartialRight7x2; + (func: lodash.Function3, arg1: [T1, T2, lodash.__]): lodash.Function1< T3, R>; + (func: lodash.__, arg3: [T3]): LodashPartialRight8x2; + (func: lodash.Function3, arg3: [T3]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3]): LodashPartialRight9x2; + (func: lodash.Function3, arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2, T3]): LodashPartialRight10x2; + (func: lodash.Function3, arg2: [T2, T3]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3]): LodashPartialRight11x2; + (func: lodash.Function3, arg1: [T1, T2, T3]): lodash.Function0< R>; + (func: lodash.Function4): LodashPartialRight12x1; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, lodash.__]): LodashPartialRight12x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, lodash.__]): lodash.Function3< T2, T3, T4, R>; + (func: lodash.__, arg2: [T2, lodash.__, lodash.__]): LodashPartialRight13x2; + (func: lodash.Function4, arg2: [T2, lodash.__, lodash.__]): lodash.Function3; + (func: lodash.__, arg1: [T1, T2, lodash.__, lodash.__]): LodashPartialRight14x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, lodash.__]): lodash.Function2< T3, T4, R>; + (func: lodash.__, arg3: [T3, lodash.__]): LodashPartialRight15x2; + (func: lodash.Function4, arg3: [T3, lodash.__]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, T3, lodash.__]): LodashPartialRight16x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, lodash.__]): lodash.Function2< T2, T4, R>; + (func: lodash.__, arg2: [T2, T3, lodash.__]): LodashPartialRight17x2; + (func: lodash.Function4, arg2: [T2, T3, lodash.__]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, T3, lodash.__]): LodashPartialRight18x2; + (func: lodash.Function4, arg1: [T1, T2, T3, lodash.__]): lodash.Function1< T4, R>; + (func: lodash.__, arg4: [T4]): LodashPartialRight19x2; + (func: lodash.Function4, arg4: [T4]): lodash.Function3; + (func: lodash.__, arg1: [T1, lodash.__, lodash.__, T4]): LodashPartialRight20x2; + (func: lodash.Function4, arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (func: lodash.__, arg2: [T2, lodash.__, T4]): LodashPartialRight21x2; + (func: lodash.Function4, arg2: [T2, lodash.__, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, T2, lodash.__, T4]): LodashPartialRight22x2; + (func: lodash.Function4, arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (func: lodash.__, arg3: [T3, T4]): LodashPartialRight23x2; + (func: lodash.Function4, arg3: [T3, T4]): lodash.Function2; + (func: lodash.__, arg1: [T1, lodash.__, T3, T4]): LodashPartialRight24x2; + (func: lodash.Function4, arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (func: lodash.__, arg2: [T2, T3, T4]): LodashPartialRight25x2; + (func: lodash.Function4, arg2: [T2, T3, T4]): lodash.Function1; + (func: lodash.__, arg1: [T1, T2, T3, T4]): LodashPartialRight26x2; + (func: lodash.Function4, arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + (func: (...args: any[]) => any): LodashPartialRight27x1; + (func: lodash.__, args: ReadonlyArray): LodashPartialRight27x2; + (func: (...args: any[]) => any, args: ReadonlyArray): (...args: any[]) => any; placeholder: lodash.__; } - type LodashPartialRight1x1 = (func: (...args: any[]) => any) => (...args: any[]) => any; - type LodashPartialRight1x2 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartialRight1x1 = (arg1: [T1]) => lodash.Function0; + type LodashPartialRight1x2 = (func: lodash.Function1) => lodash.Function0; + interface LodashPartialRight2x1 { + (arg1: [T1, lodash.__]): lodash.Function1< T2, R>; + (arg2: [T2]): lodash.Function1; + (arg1: [T1, T2]): lodash.Function0< R>; + } + type LodashPartialRight2x2 = (func: lodash.Function2) => lodash.Function1< T2, R>; + type LodashPartialRight3x2 = (func: lodash.Function2) => lodash.Function1; + type LodashPartialRight4x2 = (func: lodash.Function2) => lodash.Function0< R>; + interface LodashPartialRight5x1 { + (arg1: [T1, lodash.__, lodash.__]): lodash.Function2< T2, T3, R>; + (arg2: [T2, lodash.__]): lodash.Function2; + (arg1: [T1, T2, lodash.__]): lodash.Function1< T3, R>; + (arg3: [T3]): lodash.Function2; + (arg1: [T1, lodash.__, T3]): lodash.Function1< T2, R>; + (arg2: [T2, T3]): lodash.Function1; + (arg1: [T1, T2, T3]): lodash.Function0< R>; + } + type LodashPartialRight5x2 = (func: lodash.Function3) => lodash.Function2< T2, T3, R>; + type LodashPartialRight6x2 = (func: lodash.Function3) => lodash.Function2; + type LodashPartialRight7x2 = (func: lodash.Function3) => lodash.Function1< T3, R>; + type LodashPartialRight8x2 = (func: lodash.Function3) => lodash.Function2; + type LodashPartialRight9x2 = (func: lodash.Function3) => lodash.Function1< T2, R>; + type LodashPartialRight10x2 = (func: lodash.Function3) => lodash.Function1; + type LodashPartialRight11x2 = (func: lodash.Function3) => lodash.Function0< R>; + interface LodashPartialRight12x1 { + (arg1: [T1, lodash.__, lodash.__, lodash.__]): lodash.Function3< T2, T3, T4, R>; + (arg2: [T2, lodash.__, lodash.__]): lodash.Function3; + (arg1: [T1, T2, lodash.__, lodash.__]): lodash.Function2< T3, T4, R>; + (arg3: [T3, lodash.__]): lodash.Function3; + (arg1: [T1, lodash.__, T3, lodash.__]): lodash.Function2< T2, T4, R>; + (arg2: [T2, T3, lodash.__]): lodash.Function2; + (arg1: [T1, T2, T3, lodash.__]): lodash.Function1< T4, R>; + (arg4: [T4]): lodash.Function3; + (arg1: [T1, lodash.__, lodash.__, T4]): lodash.Function2< T2, T3, R>; + (arg2: [T2, lodash.__, T4]): lodash.Function2; + (arg1: [T1, T2, lodash.__, T4]): lodash.Function1< T3, R>; + (arg3: [T3, T4]): lodash.Function2; + (arg1: [T1, lodash.__, T3, T4]): lodash.Function1< T2, R>; + (arg2: [T2, T3, T4]): lodash.Function1; + (arg1: [T1, T2, T3, T4]): lodash.Function0< R>; + } + type LodashPartialRight12x2 = (func: lodash.Function4) => lodash.Function3< T2, T3, T4, R>; + type LodashPartialRight13x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight14x2 = (func: lodash.Function4) => lodash.Function2< T3, T4, R>; + type LodashPartialRight15x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight16x2 = (func: lodash.Function4) => lodash.Function2< T2, T4, R>; + type LodashPartialRight17x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight18x2 = (func: lodash.Function4) => lodash.Function1< T4, R>; + type LodashPartialRight19x2 = (func: lodash.Function4) => lodash.Function3; + type LodashPartialRight20x2 = (func: lodash.Function4) => lodash.Function2< T2, T3, R>; + type LodashPartialRight21x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight22x2 = (func: lodash.Function4) => lodash.Function1< T3, R>; + type LodashPartialRight23x2 = (func: lodash.Function4) => lodash.Function2; + type LodashPartialRight24x2 = (func: lodash.Function4) => lodash.Function1< T2, R>; + type LodashPartialRight25x2 = (func: lodash.Function4) => lodash.Function1; + type LodashPartialRight26x2 = (func: lodash.Function4) => lodash.Function0< R>; + type LodashPartialRight27x1 = (args: ReadonlyArray) => (...args: any[]) => any; + type LodashPartialRight27x2 = (func: (...args: any[]) => any) => (...args: any[]) => any; interface LodashPartition { (callback: lodash.ValueIteratee): LodashPartition1x1; (callback: lodash.__, collection: lodash.List | null | undefined): LodashPartition1x2; @@ -4055,7 +4326,13 @@ declare namespace _ { } type LodashZip1x1 = (arrays2: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; type LodashZip1x2 = (arrays1: lodash.List) => Array<[T1 | undefined, T2 | undefined]>; - type LodashZipAll = (arrays: ReadonlyArray | null | undefined>) => Array>; + interface LodashZipAll { + (arrays1: [lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined]>; + (arrays1: [lodash.List, lodash.List, lodash.List, lodash.List, lodash.List]): Array<[T1 | undefined, T2 | undefined, T3 | undefined, T4 | undefined, T5 | undefined]>; + (arrays: ReadonlyArray | null | undefined>): Array>; + } interface LodashZipObject { (props: lodash.List): LodashZipObject1x1; (props: lodash.__, values: lodash.List): LodashZipObject1x2; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index fbb164c4c5..08dcd31639 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5788,24 +5788,24 @@ fp.now(); // $ExpectType number const dictionary: _.Dictionary = anything; const numericDictionary: _.NumericDictionary = anything; - _.omit(obj, "a"); // $ExpectType Partial + _.omit(obj, "a"); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.4 _.omit(obj, ["b", 1], 0, "a"); // $ExpectType Partial _.omit(dictionary, "a"); // $ExpectType Dictionary _.omit(numericDictionary, "a"); // $ExpectType NumericDictionary - _(obj).omit("a"); // $ExpectType LoDashImplicitWrapper> + _(obj).omit("a"); // ExpectType LoDashImplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashImplicitWrapper> _(dictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> - _.chain(obj).omit("a"); // $ExpectType LoDashExplicitWrapper> + _.chain(obj).omit("a"); // ExpectType LoDashExplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _.chain(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> - fp.omit("a", obj); // $ExpectType Partial - fp.omit("a")(obj); // $ExpectType Partial - fp.omit(["a", "b"])(obj); // $ExpectType Partial + fp.omit("a", obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.4 + fp.omit("a")(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 + fp.omit(["a", "b"])(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 } // _.omitBy @@ -5825,7 +5825,7 @@ fp.now(); // $ExpectType number const obj1: AbcObject | null | undefined = anything; const obj2: AbcObject = anything; const readonlyArray: string[] = ["a", "b"]; // TODO: Should be ReadonlyArray, but see comment on type Many - const literalsArray = ["a" as "a", "b" as "b"]; + const literalsArray: Array<"a" | "b"> = ["a", "b"]; const roLiteralsArray: Array<"a" | "b"> = literalsArray; // TODO: Should be ReadonlyArray, but see comment on type Many _.pick(obj1, "a"); // $ExpectType PartialDeep @@ -5857,7 +5857,7 @@ fp.now(); // $ExpectType number fp.pick("a", obj2); // $ExpectType Pick fp.pick("a")(obj2); // $ExpectType Pick - fp.pick(["a" as "a", "b" as "b"])(obj2); // $ExpectType Pick + fp.pick(literalsArray)(obj2); // $ExpectType Pick } // _.pickBy @@ -6060,9 +6060,10 @@ fp.now(); // $ExpectType number _(object).unset(["a", "b"]); // $ExpectType LoDashImplicitWrapper _.chain(object).unset("a.b"); // $ExpectType LoDashExplicitWrapper _.chain(object).unset(["a", "b"]); // $ExpectType LoDashExplicitWrapper - fp.unset("a.b", object); // $ExpectType boolean - fp.unset("a.b")(object); // $ExpectType boolean - fp.unset(["a", "b"])(object); // $ExpectType boolean + + fp.unset("a.b", object); // $ExpectType { a: { b: string; c: boolean; }; } + fp.unset("a.b")(object); // $ExpectType { a: { b: string; c: boolean; }; } + fp.unset(["a", "b"])(object); // $ExpectType { a: { b: string; c: boolean; }; } } // _.update @@ -7251,11 +7252,10 @@ _.templateSettings; // $ExpectType TemplateSettings // with arity 3 function _.partialRight(func3, 42, _, true); - fp.partial([], func0); // $ExpectType (...args: any[]) => any - fp.partial([])(func0); // $ExpectType (...args: any[]) => any - fp.partial([42])(func1); // $ExpectType (...args: any[]) => any - fp.partial([fp.partial.placeholder, "foo"])(func2); - fp.partialRight([])(func0); // $ExpectType (...args: any[]) => any - fp.partialRight([42])(func1); // $ExpectType (...args: any[]) => any - fp.partialRight([fp.partialRight.placeholder, "foo"])(func2); + fp.partial(func1, [42]); // $ExpectType Function0 + fp.partial(func1)([42]); // $ExpectType Function0 + fp.partial(func2)([fp.partial.placeholder, "foo"]); // $ExpectType Function1 + fp.partialRight(func1, [42]); // $ExpectType Function0 + fp.partialRight(func1)([42]); // $ExpectType Function0 + fp.partialRight(func2)([42, fp.partialRight.placeholder]); // $ExpectType Function1 } diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index 77f11b46ac..9a03fef544 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -174,15 +174,14 @@ async function processDefinitions(filePaths: string[], commonTypes: string[]): P } else if (args.length > 4 || definition.name === "flow" || definition.name === "flowRight") { // Arity wasn't fixed by convert() isFixed = false; - } else { - // For some reason, convert() doesn't seems to tell us which functions have unchanged argument order. - // So we have to hard-code it. - const unchangedOrders = ["add", "assign", "assignIn", "bind", "bindKey", "concat", "difference", "divide", "eq", - "gt", "gte", "isEqual", "lt", "lte", "matchesProperty", "merge", "multiply", "overArgs", "partial", "partialRight", - "propertyOf", "random", "range", "rangeRight", "subtract", "zip", "zipObject", "zipObjectDeep"]; - if (unchangedOrders.includes(definition.name)) - args = _.sortBy(args as number[][], (a: number[]) => a[0]); } + // For some reason, convert() doesn't seems to tell us which functions have unchanged argument order. + // So we have to hard-code it. + const unchangedOrders = ["add", "assign", "assignIn", "bind", "bindKey", "concat", "difference", "divide", "eq", + "gt", "gte", "isEqual", "lt", "lte", "matchesProperty", "merge", "multiply", "overArgs", "partial", "partialRight", + "propertyOf", "random", "range", "rangeRight", "subtract", "zip", "zipObject", "zipObjectDeep"]; + if (unchangedOrders.includes(definition.name)) + args = _.sortBy(args, a => typeof a === "number" ? a : a[0]); return () => curryDefinition(definition, _.flatten(args), spreadIndex, isFixed); }; @@ -324,6 +323,12 @@ function parseDefinitions(definitionString: string, startIndex: number, endIndex .map(o => _.trim(o, ",")) .filter(o => !!o); overload.returnType = overloadString.substring(paramEndIndex + 2).trim(); + // Special case for unset: the return type should be the input type, not bolean. See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/25361 + if (name === "unset") { + overload.typeParams = [{ name: "T" }]; + overload.params[0] = overload.params[0].replace(/\bany\b/, "T"); + overload.returnType = "T"; + } currentDefinition.overloads.push(overload); } else { // This overload actually points to an interface. Try to find said interface and get the overloads from there. @@ -433,25 +438,33 @@ function curryDefinition(definition: Definition, paramOrder: number[], spreadInd // Spread/rest parameters could be in any of the following formats: // 1. The rest parameter is at spreadIndex, and it is the last parameter. // 2. The rest parameter is immediately after spreadIndex, e.g. assign(object, ...sources[]). In this case, convert it to assignAll(...object[]) - // 3. The rest parameter is not the last parameter, e.g. assignWith(object, ...sources[], customizer) + // 3. The overload defines no rest parameters, e.g. mergeAll(T1, T2, T3) + // 4. The rest parameter is not the last parameter, e.g. assignWith(object, ...sources[], customizer) if (spreadIndex === arity - 1) { - // cases 1-2 for (let i = 0; i < overloads.length; ++i) { const overload = overloads[i]; if (overload.params.length === arity && overload.params[spreadIndex] && overload.params[spreadIndex].startsWith("...")) { + // case 1 overload.params[spreadIndex] = overload.params[spreadIndex].replace("...", ""); } else if (overload.params.length === arity + 1 && overload.params[spreadIndex + 1] && overload.params[spreadIndex + 1].startsWith("...")) { + // case 2 overload.params.splice(spreadIndex + 1, 1); const parts = overload.params[spreadIndex].split(":").map(_.trim); parts[1] = `ReadonlyArray<${parts[1]}>`; overload.params[spreadIndex] = `${parts[0]}: ${parts[1]}`; + } else if (overload.params.length >= arity && overload.params[spreadIndex] && !overload.params.some(p => p.startsWith("..."))) { + // case 3 + const paramName = getParamName(overload.params[spreadIndex]); + const spreadParamTypes = overload.params.slice(spreadIndex).map(getParamType); + overload.params = overload.params.slice(0, spreadIndex); + overload.params.push(`${paramName}: [${spreadParamTypes.join(", ")}]`); } else { _.pull(overloads, overload); --i; } } } else { - // case 3 + // case 4 const overload = overloads[0]; overloads = [{ jsdoc: overload.jsdoc, diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 78ff4901af..982826fe5b 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -127,7 +127,7 @@ declare module "./index" { first(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; flatten(this: LoDashExplicitSyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; flattenDeep(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitSyncWrapper; - flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; + flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; fromPairs( this: LoDashExplicitSyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitSyncWrapper<_.Dictionary>; @@ -1263,11 +1263,15 @@ declare module "./index" { ): LoDashExplicitSyncWrapper; omit( this: LoDashExplicitSyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: Array<_.Many> + ): LoDashExplicitSyncWrapper<_.Omit>; omit( this: LoDashExplicitSyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitSyncWrapper<_.PartialObject>; omitBy( this: LoDashExplicitSyncWrapper, @@ -1691,7 +1695,7 @@ declare module "./index" { first(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; flatten(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; flattenDeep(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitAsyncWrapper; - flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; + flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; fromPairs( this: LoDashExplicitAsyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitAsyncWrapper<_.Dictionary>; @@ -2827,11 +2831,15 @@ declare module "./index" { ): LoDashExplicitAsyncWrapper; omit( this: LoDashExplicitAsyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: Array<_.Many> + ): LoDashExplicitAsyncWrapper<_.Omit>; omit( this: LoDashExplicitAsyncWrapper, - ...paths: _.PropertyPath[] + ...paths: Array<_.Many<_.PropertyName>> ): LoDashExplicitAsyncWrapper<_.PartialObject>; omitBy( this: LoDashExplicitAsyncWrapper, From d45c6ed0629a47f49f412b7a3872fccafe5c6929 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Sat, 5 May 2018 17:01:11 -0400 Subject: [PATCH 5/7] lodash: fix test failures --- types/lodash/common/common.d.ts | 3 +-- types/lodash/lodash-tests.ts | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index b5da2a8080..d0856a006b 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -217,8 +217,7 @@ declare module "../index" { type PropertyName = string | number | symbol; type PropertyPath = Many; - type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; - type Omit = Pick>; + type Omit = Pick; /** Common interface between Arrays and jQuery objects */ type List = ArrayLike; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 08dcd31639..6f4fae8529 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5396,7 +5396,7 @@ fp.now(); // $ExpectType number _.chain("abc").get(1); // $ExpectType LoDashExplicitWrapper _.chain("abc").get(["0"], "_"); - _.chain([42]).get(0, -1); // $ExpectType LoDashExplicitWrapper + _.chain([42]).get(0, -1); // ExpectType LoDashExplicitWrapper _.chain({ a: { b: true } }).get("a"); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> _.chain({ a: { b: true } }).get(["a"]); // $ExpectType LoDashExplicitWrapper<{ b: boolean; }> _.chain({ a: { b: true } }).get(["a", "b"]); // $ExpectType LoDashExplicitWrapper @@ -6939,13 +6939,13 @@ fp.now(); // $ExpectType number { const object: AbcObject = anything; - _.methodOf(object); // $ExpectType (path: Many) => any - _.methodOf(object, anything, anything, anything); // $ExpectType (path: Many) => any - _(object).methodOf(); // $ExpectType LoDashImplicitWrapper<(path: Many) => any> - _(object).methodOf(anything, anything, anything); // $ExpectType LoDashImplicitWrapper<(path: Many) => any> - _.chain(object).methodOf(); // $ExpectType LoDashExplicitWrapper<(path: Many) => any> - _.chain(object).methodOf(anything, anything, anything); // $ExpectType LoDashExplicitWrapper<(path: Many) => any> - fp.methodOf(object); // $ExpectType (path: Many) => any + _.methodOf(object) as (path: _.Many<_.PropertyName>) => any; + _.methodOf(object, anything, anything, anything) as (path: _.Many<_.PropertyName>) => any; + _(object).methodOf() as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _(object).methodOf(anything, anything, anything) as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _.chain(object).methodOf() as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _.chain(object).methodOf(anything, anything, anything) as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + fp.methodOf(object) as (path: _.Many<_.PropertyName>) => any; } // _.mixin @@ -7077,9 +7077,9 @@ fp.now(); // $ExpectType number // _.propertyOf { - _.propertyOf({}); // $ExpectType (path: Many) => any - _({}).propertyOf(); // $ExpectType LoDashImplicitWrapper<(path: Many) => any> - _.chain({}).propertyOf(); // $ExpectType LoDashExplicitWrapper<(path: Many) => any> + _.propertyOf({}) as (path: _.Many<_.PropertyName>) => any; + _({}).propertyOf() as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _.chain({}).propertyOf() as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; fp.propertyOf(Symbol.iterator)([]); // $ExpectType any fp.propertyOf([Symbol.iterator], []); // $ExpectType any From 207c35ed90020228f7eae20e6c511274a4afdf8f Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Sat, 12 May 2018 08:36:50 -0400 Subject: [PATCH 6/7] Remove trivial files from tsconfig.json to avoid memory errors in tests --- types/lodash/common/array.d.ts | 32 +- types/lodash/lodash-tests.ts | 8 +- types/lodash/tsconfig.json | 686 +-------------------------------- types/lowdb/_lodash.d.ts | 4 +- 4 files changed, 23 insertions(+), 707 deletions(-) diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts index 5591bce088..6d4aff3056 100644 --- a/types/lodash/common/array.d.ts +++ b/types/lodash/common/array.d.ts @@ -929,28 +929,28 @@ declare module "../index" { // flattenDepth interface LoDashStatic { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; + /** + * Recursively flatten array up to depth times. + * + * @param array The array to recursively flatten. + * @param number The maximum recursion depth. + * @return Returns the new flattened array. + */ + flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; } interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; + /** + * @see _.flattenDeep + */ + flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper; } // fromPairs diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 6f4fae8529..52514f16f1 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -5793,19 +5793,19 @@ fp.now(); // $ExpectType number _.omit(dictionary, "a"); // $ExpectType Dictionary _.omit(numericDictionary, "a"); // $ExpectType NumericDictionary - _(obj).omit("a"); // ExpectType LoDashImplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 + _(obj).omit("a"); // ExpectType LoDashImplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashImplicitWrapper> _(dictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).omit("a"); // $ExpectType LoDashImplicitWrapper> - _.chain(obj).omit("a"); // ExpectType LoDashExplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 + _.chain(obj).omit("a"); // ExpectType LoDashExplicitWrapper> // NOTE: ExpectType disabled because it fails in TS2.4 _.chain(obj).omit(["b", 1], 0, "a"); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).omit("a"); // $ExpectType LoDashExplicitWrapper> fp.omit("a", obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.4 - fp.omit("a")(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 - fp.omit(["a", "b"])(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 + fp.omit("a")(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 + fp.omit(["a", "b"])(obj); // ExpectType Pick // NOTE: ExpectType disabled because it fails in TS2.3 } // _.omitBy diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 60a2e8323c..5a160103d4 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -20,305 +20,7 @@ "files": [ "index.d.ts", "lodash-tests.ts", - "add.d.ts", - "after.d.ts", - "ary.d.ts", - "assign.d.ts", - "assignIn.d.ts", - "assignInWith.d.ts", - "assignWith.d.ts", - "at.d.ts", - "attempt.d.ts", - "before.d.ts", - "bind.d.ts", - "bindAll.d.ts", - "bindKey.d.ts", - "camelCase.d.ts", - "capitalize.d.ts", - "castArray.d.ts", - "ceil.d.ts", - "chain.d.ts", - "chunk.d.ts", - "clamp.d.ts", - "clone.d.ts", - "cloneDeep.d.ts", - "cloneDeepWith.d.ts", - "cloneWith.d.ts", - "compact.d.ts", - "concat.d.ts", - "cond.d.ts", - "conformsTo.d.ts", - "constant.d.ts", - "countBy.d.ts", - "create.d.ts", - "curry.d.ts", - "curryRight.d.ts", - "debounce.d.ts", - "deburr.d.ts", - "defaults.d.ts", - "defaultsDeep.d.ts", - "defaultTo.d.ts", - "defer.d.ts", - "delay.d.ts", - "difference.d.ts", - "differenceBy.d.ts", - "differenceWith.d.ts", - "divide.d.ts", - "drop.d.ts", - "dropRight.d.ts", - "dropRightWhile.d.ts", - "dropWhile.d.ts", - "each.d.ts", - "eachRight.d.ts", - "endsWith.d.ts", - "entries.d.ts", - "entriesIn.d.ts", - "eq.d.ts", - "escape.d.ts", - "escapeRegExp.d.ts", - "every.d.ts", - "extend.d.ts", - "extendWith.d.ts", - "fill.d.ts", - "filter.d.ts", - "find.d.ts", - "findIndex.d.ts", - "findKey.d.ts", - "findLast.d.ts", - "findLastIndex.d.ts", - "findLastKey.d.ts", - "first.d.ts", - "flatMap.d.ts", - "flatMapDeep.d.ts", - "flatMapDepth.d.ts", - "flatten.d.ts", - "flattenDeep.d.ts", - "flattenDepth.d.ts", - "flip.d.ts", - "floor.d.ts", - "flow.d.ts", - "flowRight.d.ts", - "forEach.d.ts", - "forEachRight.d.ts", - "forIn.d.ts", - "forInRight.d.ts", - "forOwn.d.ts", - "forOwnRight.d.ts", "fp.d.ts", - "fromPairs.d.ts", - "functions.d.ts", - "functionsIn.d.ts", - "get.d.ts", - "groupBy.d.ts", - "gt.d.ts", - "gte.d.ts", - "has.d.ts", - "hasIn.d.ts", - "head.d.ts", - "identity.d.ts", - "includes.d.ts", - "indexOf.d.ts", - "initial.d.ts", - "inRange.d.ts", - "intersection.d.ts", - "intersectionBy.d.ts", - "intersectionWith.d.ts", - "invert.d.ts", - "invertBy.d.ts", - "invoke.d.ts", - "invokeMap.d.ts", - "isArguments.d.ts", - "isArray.d.ts", - "isArrayBuffer.d.ts", - "isArrayLike.d.ts", - "isArrayLikeObject.d.ts", - "isBoolean.d.ts", - "isBuffer.d.ts", - "isDate.d.ts", - "isElement.d.ts", - "isEmpty.d.ts", - "isEqual.d.ts", - "isEqualWith.d.ts", - "isError.d.ts", - "isFinite.d.ts", - "isFunction.d.ts", - "isInteger.d.ts", - "isLength.d.ts", - "isMap.d.ts", - "isMatch.d.ts", - "isMatchWith.d.ts", - "isNaN.d.ts", - "isNative.d.ts", - "isNil.d.ts", - "isNull.d.ts", - "isNumber.d.ts", - "isObject.d.ts", - "isObjectLike.d.ts", - "isPlainObject.d.ts", - "isRegExp.d.ts", - "isSafeInteger.d.ts", - "isSet.d.ts", - "isString.d.ts", - "isSymbol.d.ts", - "isTypedArray.d.ts", - "isUndefined.d.ts", - "isWeakMap.d.ts", - "isWeakSet.d.ts", - "iteratee.d.ts", - "join.d.ts", - "kebabCase.d.ts", - "keyBy.d.ts", - "keys.d.ts", - "keysIn.d.ts", - "last.d.ts", - "lastIndexOf.d.ts", - "lowerCase.d.ts", - "lowerFirst.d.ts", - "lt.d.ts", - "lte.d.ts", - "map.d.ts", - "mapKeys.d.ts", - "mapValues.d.ts", - "matches.d.ts", - "matchesProperty.d.ts", - "max.d.ts", - "maxBy.d.ts", - "mean.d.ts", - "meanBy.d.ts", - "memoize.d.ts", - "merge.d.ts", - "mergeWith.d.ts", - "method.d.ts", - "methodOf.d.ts", - "min.d.ts", - "minBy.d.ts", - "mixin.d.ts", - "negate.d.ts", - "noConflict.d.ts", - "noop.d.ts", - "now.d.ts", - "nth.d.ts", - "nthArg.d.ts", - "omit.d.ts", - "omitBy.d.ts", - "once.d.ts", - "orderBy.d.ts", - "over.d.ts", - "overArgs.d.ts", - "overEvery.d.ts", - "overSome.d.ts", - "pad.d.ts", - "padEnd.d.ts", - "padStart.d.ts", - "parseInt.d.ts", - "partial.d.ts", - "partialRight.d.ts", - "partition.d.ts", - "pick.d.ts", - "pickBy.d.ts", - "property.d.ts", - "propertyOf.d.ts", - "pull.d.ts", - "pullAll.d.ts", - "pullAllBy.d.ts", - "pullAllWith.d.ts", - "pullAt.d.ts", - "random.d.ts", - "range.d.ts", - "rangeRight.d.ts", - "rearg.d.ts", - "reduce.d.ts", - "reduceRight.d.ts", - "reject.d.ts", - "remove.d.ts", - "repeat.d.ts", - "replace.d.ts", - "rest.d.ts", - "result.d.ts", - "reverse.d.ts", - "round.d.ts", - "runInContext.d.ts", - "sample.d.ts", - "sampleSize.d.ts", - "set.d.ts", - "setWith.d.ts", - "shuffle.d.ts", - "size.d.ts", - "slice.d.ts", - "snakeCase.d.ts", - "some.d.ts", - "sortBy.d.ts", - "sortedIndex.d.ts", - "sortedIndexBy.d.ts", - "sortedIndexOf.d.ts", - "sortedLastIndex.d.ts", - "sortedLastIndexBy.d.ts", - "sortedLastIndexOf.d.ts", - "sortedUniq.d.ts", - "sortedUniqBy.d.ts", - "split.d.ts", - "spread.d.ts", - "startCase.d.ts", - "startsWith.d.ts", - "subtract.d.ts", - "sum.d.ts", - "sumBy.d.ts", - "tail.d.ts", - "take.d.ts", - "takeRight.d.ts", - "takeRightWhile.d.ts", - "takeWhile.d.ts", - "tap.d.ts", - "template.d.ts", - "throttle.d.ts", - "thru.d.ts", - "times.d.ts", - "toArray.d.ts", - "toFinite.d.ts", - "toInteger.d.ts", - "toLength.d.ts", - "toLower.d.ts", - "toNumber.d.ts", - "toPairs.d.ts", - "toPairsIn.d.ts", - "toPath.d.ts", - "toPlainObject.d.ts", - "toSafeInteger.d.ts", - "toString.d.ts", - "toUpper.d.ts", - "transform.d.ts", - "trim.d.ts", - "trimEnd.d.ts", - "trimStart.d.ts", - "truncate.d.ts", - "unary.d.ts", - "unescape.d.ts", - "union.d.ts", - "unionBy.d.ts", - "unionWith.d.ts", - "uniq.d.ts", - "uniqBy.d.ts", - "uniqueId.d.ts", - "uniqWith.d.ts", - "unset.d.ts", - "unzip.d.ts", - "unzipWith.d.ts", - "update.d.ts", - "updateWith.d.ts", - "upperCase.d.ts", - "upperFirst.d.ts", - "values.d.ts", - "valuesIn.d.ts", - "without.d.ts", - "words.d.ts", - "wrap.d.ts", - "xor.d.ts", - "xorBy.d.ts", - "xorWith.d.ts", - "zip.d.ts", - "zipObject.d.ts", - "zipObjectDeep.d.ts", - "zipWith.d.ts", "common/array.d.ts", "common/collection.d.ts", "common/common.d.ts", @@ -330,392 +32,6 @@ "common/object.d.ts", "common/seq.d.ts", "common/string.d.ts", - "common/util.d.ts", - "fp/convert.d.ts", - "fp/add.d.ts", - "fp/after.d.ts", - "fp/all.d.ts", - "fp/allPass.d.ts", - "fp/always.d.ts", - "fp/any.d.ts", - "fp/anyPass.d.ts", - "fp/apply.d.ts", - "fp/ary.d.ts", - "fp/assign.d.ts", - "fp/assignAll.d.ts", - "fp/assignAllWith.d.ts", - "fp/assignIn.d.ts", - "fp/assignInAll.d.ts", - "fp/assignInAllWith.d.ts", - "fp/assignInWith.d.ts", - "fp/assignWith.d.ts", - "fp/assoc.d.ts", - "fp/assocPath.d.ts", - "fp/at.d.ts", - "fp/attempt.d.ts", - "fp/before.d.ts", - "fp/bind.d.ts", - "fp/bindAll.d.ts", - "fp/bindKey.d.ts", - "fp/camelCase.d.ts", - "fp/capitalize.d.ts", - "fp/castArray.d.ts", - "fp/ceil.d.ts", - "fp/chunk.d.ts", - "fp/clamp.d.ts", - "fp/clone.d.ts", - "fp/cloneDeep.d.ts", - "fp/cloneDeepWith.d.ts", - "fp/cloneWith.d.ts", - "fp/compact.d.ts", - "fp/complement.d.ts", - "fp/compose.d.ts", - "fp/concat.d.ts", - "fp/cond.d.ts", - "fp/conforms.d.ts", - "fp/conformsTo.d.ts", - "fp/constant.d.ts", - "fp/contains.d.ts", - "fp/countBy.d.ts", - "fp/create.d.ts", - "fp/curry.d.ts", - "fp/curryN.d.ts", - "fp/curryRight.d.ts", - "fp/curryRightN.d.ts", - "fp/debounce.d.ts", - "fp/deburr.d.ts", - "fp/defaults.d.ts", - "fp/defaultsAll.d.ts", - "fp/defaultsDeep.d.ts", - "fp/defaultsDeepAll.d.ts", - "fp/defaultTo.d.ts", - "fp/defer.d.ts", - "fp/delay.d.ts", - "fp/difference.d.ts", - "fp/differenceBy.d.ts", - "fp/differenceWith.d.ts", - "fp/dissoc.d.ts", - "fp/dissocPath.d.ts", - "fp/divide.d.ts", - "fp/drop.d.ts", - "fp/dropLast.d.ts", - "fp/dropLastWhile.d.ts", - "fp/dropRight.d.ts", - "fp/dropRightWhile.d.ts", - "fp/dropWhile.d.ts", - "fp/each.d.ts", - "fp/eachRight.d.ts", - "fp/endsWith.d.ts", - "fp/entries.d.ts", - "fp/entriesIn.d.ts", - "fp/eq.d.ts", - "fp/equals.d.ts", - "fp/escape.d.ts", - "fp/escapeRegExp.d.ts", - "fp/every.d.ts", - "fp/extend.d.ts", - "fp/extendAll.d.ts", - "fp/extendAllWith.d.ts", - "fp/extendWith.d.ts", - "fp/F.d.ts", - "fp/fill.d.ts", - "fp/filter.d.ts", - "fp/find.d.ts", - "fp/findFrom.d.ts", - "fp/findIndex.d.ts", - "fp/findIndexFrom.d.ts", - "fp/findKey.d.ts", - "fp/findLast.d.ts", - "fp/findLastFrom.d.ts", - "fp/findLastIndex.d.ts", - "fp/findLastIndexFrom.d.ts", - "fp/findLastKey.d.ts", - "fp/first.d.ts", - "fp/flatMap.d.ts", - "fp/flatMapDeep.d.ts", - "fp/flatMapDepth.d.ts", - "fp/flatten.d.ts", - "fp/flattenDeep.d.ts", - "fp/flattenDepth.d.ts", - "fp/flip.d.ts", - "fp/floor.d.ts", - "fp/flow.d.ts", - "fp/flowRight.d.ts", - "fp/forEach.d.ts", - "fp/forEachRight.d.ts", - "fp/forIn.d.ts", - "fp/forInRight.d.ts", - "fp/forOwn.d.ts", - "fp/forOwnRight.d.ts", - "fp/fromPairs.d.ts", - "fp/functions.d.ts", - "fp/functionsIn.d.ts", - "fp/get.d.ts", - "fp/getOr.d.ts", - "fp/groupBy.d.ts", - "fp/gt.d.ts", - "fp/gte.d.ts", - "fp/has.d.ts", - "fp/hasIn.d.ts", - "fp/head.d.ts", - "fp/identical.d.ts", - "fp/identity.d.ts", - "fp/includes.d.ts", - "fp/includesFrom.d.ts", - "fp/indexBy.d.ts", - "fp/indexOf.d.ts", - "fp/indexOfFrom.d.ts", - "fp/init.d.ts", - "fp/initial.d.ts", - "fp/inRange.d.ts", - "fp/intersection.d.ts", - "fp/intersectionBy.d.ts", - "fp/intersectionWith.d.ts", - "fp/invert.d.ts", - "fp/invertBy.d.ts", - "fp/invertObj.d.ts", - "fp/invoke.d.ts", - "fp/invokeArgs.d.ts", - "fp/invokeArgsMap.d.ts", - "fp/invokeMap.d.ts", - "fp/isArguments.d.ts", - "fp/isArray.d.ts", - "fp/isArrayBuffer.d.ts", - "fp/isArrayLike.d.ts", - "fp/isArrayLikeObject.d.ts", - "fp/isBoolean.d.ts", - "fp/isBuffer.d.ts", - "fp/isDate.d.ts", - "fp/isElement.d.ts", - "fp/isEmpty.d.ts", - "fp/isEqual.d.ts", - "fp/isEqualWith.d.ts", - "fp/isError.d.ts", - "fp/isFinite.d.ts", - "fp/isFunction.d.ts", - "fp/isInteger.d.ts", - "fp/isLength.d.ts", - "fp/isMap.d.ts", - "fp/isMatch.d.ts", - "fp/isMatchWith.d.ts", - "fp/isNaN.d.ts", - "fp/isNative.d.ts", - "fp/isNil.d.ts", - "fp/isNull.d.ts", - "fp/isNumber.d.ts", - "fp/isObject.d.ts", - "fp/isObjectLike.d.ts", - "fp/isPlainObject.d.ts", - "fp/isRegExp.d.ts", - "fp/isSafeInteger.d.ts", - "fp/isSet.d.ts", - "fp/isString.d.ts", - "fp/isSymbol.d.ts", - "fp/isTypedArray.d.ts", - "fp/isUndefined.d.ts", - "fp/isWeakMap.d.ts", - "fp/isWeakSet.d.ts", - "fp/iteratee.d.ts", - "fp/join.d.ts", - "fp/juxt.d.ts", - "fp/kebabCase.d.ts", - "fp/keyBy.d.ts", - "fp/keys.d.ts", - "fp/keysIn.d.ts", - "fp/last.d.ts", - "fp/lastIndexOf.d.ts", - "fp/lastIndexOfFrom.d.ts", - "fp/lowerCase.d.ts", - "fp/lowerFirst.d.ts", - "fp/lt.d.ts", - "fp/lte.d.ts", - "fp/map.d.ts", - "fp/mapKeys.d.ts", - "fp/mapValues.d.ts", - "fp/matches.d.ts", - "fp/matchesProperty.d.ts", - "fp/max.d.ts", - "fp/maxBy.d.ts", - "fp/mean.d.ts", - "fp/meanBy.d.ts", - "fp/memoize.d.ts", - "fp/merge.d.ts", - "fp/mergeAll.d.ts", - "fp/mergeAllWith.d.ts", - "fp/mergeWith.d.ts", - "fp/method.d.ts", - "fp/methodOf.d.ts", - "fp/min.d.ts", - "fp/minBy.d.ts", - "fp/multiply.d.ts", - "fp/nAry.d.ts", - "fp/negate.d.ts", - "fp/noConflict.d.ts", - "fp/noop.d.ts", - "fp/now.d.ts", - "fp/nth.d.ts", - "fp/nthArg.d.ts", - "fp/omit.d.ts", - "fp/omitAll.d.ts", - "fp/omitBy.d.ts", - "fp/once.d.ts", - "fp/orderBy.d.ts", - "fp/over.d.ts", - "fp/overArgs.d.ts", - "fp/overEvery.d.ts", - "fp/overSome.d.ts", - "fp/pad.d.ts", - "fp/padChars.d.ts", - "fp/padCharsEnd.d.ts", - "fp/padCharsStart.d.ts", - "fp/padEnd.d.ts", - "fp/padStart.d.ts", - "fp/parseInt.d.ts", - "fp/partial.d.ts", - "fp/partialRight.d.ts", - "fp/partition.d.ts", - "fp/path.d.ts", - "fp/pathEq.d.ts", - "fp/pathOr.d.ts", - "fp/paths.d.ts", - "fp/pick.d.ts", - "fp/pickAll.d.ts", - "fp/pickBy.d.ts", - "fp/pipe.d.ts", - "fp/pluck.d.ts", - "fp/prop.d.ts", - "fp/propEq.d.ts", - "fp/property.d.ts", - "fp/propertyOf.d.ts", - "fp/propOr.d.ts", - "fp/props.d.ts", - "fp/pull.d.ts", - "fp/pullAll.d.ts", - "fp/pullAllBy.d.ts", - "fp/pullAllWith.d.ts", - "fp/pullAt.d.ts", - "fp/random.d.ts", - "fp/range.d.ts", - "fp/rangeRight.d.ts", - "fp/rangeStep.d.ts", - "fp/rangeStepRight.d.ts", - "fp/rearg.d.ts", - "fp/reduce.d.ts", - "fp/reduceRight.d.ts", - "fp/reject.d.ts", - "fp/remove.d.ts", - "fp/repeat.d.ts", - "fp/replace.d.ts", - "fp/rest.d.ts", - "fp/restFrom.d.ts", - "fp/result.d.ts", - "fp/reverse.d.ts", - "fp/round.d.ts", - "fp/runInContext.d.ts", - "fp/sample.d.ts", - "fp/sampleSize.d.ts", - "fp/set.d.ts", - "fp/setWith.d.ts", - "fp/shuffle.d.ts", - "fp/size.d.ts", - "fp/slice.d.ts", - "fp/snakeCase.d.ts", - "fp/some.d.ts", - "fp/sortBy.d.ts", - "fp/sortedIndex.d.ts", - "fp/sortedIndexBy.d.ts", - "fp/sortedIndexOf.d.ts", - "fp/sortedLastIndex.d.ts", - "fp/sortedLastIndexBy.d.ts", - "fp/sortedLastIndexOf.d.ts", - "fp/sortedUniq.d.ts", - "fp/sortedUniqBy.d.ts", - "fp/split.d.ts", - "fp/spread.d.ts", - "fp/spreadFrom.d.ts", - "fp/startCase.d.ts", - "fp/startsWith.d.ts", - "fp/stubArray.d.ts", - "fp/stubFalse.d.ts", - "fp/stubObject.d.ts", - "fp/stubString.d.ts", - "fp/stubTrue.d.ts", - "fp/subtract.d.ts", - "fp/sum.d.ts", - "fp/sumBy.d.ts", - "fp/symmetricDifference.d.ts", - "fp/symmetricDifferenceBy.d.ts", - "fp/symmetricDifferenceWith.d.ts", - "fp/T.d.ts", - "fp/tail.d.ts", - "fp/take.d.ts", - "fp/takeLast.d.ts", - "fp/takeLastWhile.d.ts", - "fp/takeRight.d.ts", - "fp/takeRightWhile.d.ts", - "fp/takeWhile.d.ts", - "fp/tap.d.ts", - "fp/template.d.ts", - "fp/throttle.d.ts", - "fp/thru.d.ts", - "fp/times.d.ts", - "fp/toArray.d.ts", - "fp/toFinite.d.ts", - "fp/toInteger.d.ts", - "fp/toLength.d.ts", - "fp/toLower.d.ts", - "fp/toNumber.d.ts", - "fp/toPairs.d.ts", - "fp/toPairsIn.d.ts", - "fp/toPath.d.ts", - "fp/toPlainObject.d.ts", - "fp/toSafeInteger.d.ts", - "fp/toString.d.ts", - "fp/toUpper.d.ts", - "fp/transform.d.ts", - "fp/trim.d.ts", - "fp/trimChars.d.ts", - "fp/trimCharsEnd.d.ts", - "fp/trimCharsStart.d.ts", - "fp/trimEnd.d.ts", - "fp/trimStart.d.ts", - "fp/truncate.d.ts", - "fp/unapply.d.ts", - "fp/unary.d.ts", - "fp/unescape.d.ts", - "fp/union.d.ts", - "fp/unionBy.d.ts", - "fp/unionWith.d.ts", - "fp/uniq.d.ts", - "fp/uniqBy.d.ts", - "fp/uniqueId.d.ts", - "fp/uniqWith.d.ts", - "fp/unnest.d.ts", - "fp/unset.d.ts", - "fp/unzip.d.ts", - "fp/unzipWith.d.ts", - "fp/update.d.ts", - "fp/updateWith.d.ts", - "fp/upperCase.d.ts", - "fp/upperFirst.d.ts", - "fp/useWith.d.ts", - "fp/values.d.ts", - "fp/valuesIn.d.ts", - "fp/where.d.ts", - "fp/whereEq.d.ts", - "fp/without.d.ts", - "fp/words.d.ts", - "fp/wrap.d.ts", - "fp/xor.d.ts", - "fp/xorBy.d.ts", - "fp/xorWith.d.ts", - "fp/zip.d.ts", - "fp/zipAll.d.ts", - "fp/zipObj.d.ts", - "fp/zipObject.d.ts", - "fp/zipObjectDeep.d.ts", - "fp/zipWith.d.ts", - "fp/__.d.ts", - "fp/placeholder.d.ts" + "common/util.d.ts" ] } \ No newline at end of file diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 982826fe5b..a7d2c424f0 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -127,7 +127,7 @@ declare module "./index" { first(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; flatten(this: LoDashExplicitSyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; flattenDeep(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitSyncWrapper; - flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; + flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; fromPairs( this: LoDashExplicitSyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitSyncWrapper<_.Dictionary>; @@ -1695,7 +1695,7 @@ declare module "./index" { first(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; flatten(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; flattenDeep(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitAsyncWrapper; - flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; + flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; fromPairs( this: LoDashExplicitAsyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> ): LoDashExplicitAsyncWrapper<_.Dictionary>; From 79b40511a06e9e4079808147630cdb2bca3ebc33 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Sat, 12 May 2018 10:13:44 -0400 Subject: [PATCH 7/7] Trim down tests to avoid memory error --- types/lodash/lodash-tests.ts | 810 ++++++++++++----------------------- types/lodash/tsconfig.json | 686 ++++++++++++++++++++++++++++- 2 files changed, 956 insertions(+), 540 deletions(-) diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 52514f16f1..88a5a88bfc 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -9,6 +9,20 @@ interface AbcObject { c: boolean; } +const abcObject: AbcObject = anything; +const array: AbcObject[] | null | undefined = anything; +const list: _.List | null | undefined = anything; +const dictionary: _.Dictionary | null | undefined = anything; +const numericDictionary: _.NumericDictionary | null | undefined = anything; +const arrayParam: AbcObject[] = []; +const listParam: _.List = []; +const comparator = (a: AbcObject, b: AbcObject) => true; +const listIterator = (value: AbcObject, index: number, collection: _.List) => true; +const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; +const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => true; +const valueIterator = (value: AbcObject) => true; +const stringIterator = (value: string) => ""; + // Wrapped array shortcut methods _([1, 2, 3, 4]).pop(); // $ExpectType number | undefined _([1, 2, 3, 4]).push(5, 6, 7); // $ExpectType LoDashImplicitWrapper @@ -32,8 +46,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.chunk(list); // $ExpectType AbcObject[][] _.chunk(list, 42); // $ExpectType AbcObject[][] @@ -60,10 +72,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const arrayParam: AbcObject[] = []; - const listParam: _.List = []; - _.difference(list); // $ExpectType AbcObject[] _.difference(list, listParam); // $ExpectType AbcObject[] _.difference(list, listParam, arrayParam, listParam); // $ExpectType AbcObject[] @@ -82,19 +90,14 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const arrayParam: AbcObject[] = []; - const listParam: _.List = []; - const iteratee = (value: AbcObject) => 1; - _.differenceBy(list); // $ExpectType AbcObject[] _.differenceBy(list, listParam); // $ExpectType AbcObject[] _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); // $ExpectType AbcObject[] - _.differenceBy(list, listParam, iteratee); // $ExpectType AbcObject[] - _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); // $ExpectType AbcObject[] + _.differenceBy(list, listParam, valueIterator); // $ExpectType AbcObject[] + _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, valueIterator); // $ExpectType AbcObject[] // $ExpectType AbcObject[] - _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + _.differenceBy(list, arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, valueIterator); _.differenceBy(list, listParam, "a"); // $ExpectType AbcObject[] _.differenceBy(list, listParam, arrayParam, listParam, arrayParam, listParam, "a"); // $ExpectType AbcObject[] @@ -109,10 +112,10 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam); // $ExpectType LoDashImplicitWrapper - _(list).differenceBy(listParam, iteratee); // $ExpectType LoDashImplicitWrapper - _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, iteratee); // $ExpectType LoDashImplicitWrapper + _(list).differenceBy(listParam, valueIterator); // $ExpectType LoDashImplicitWrapper + _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, valueIterator); // $ExpectType LoDashImplicitWrapper // $ExpectType LoDashImplicitWrapper - _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, iteratee); + _(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, listParam, valueIterator); _(list).differenceBy(listParam, "a"); // $ExpectType LoDashImplicitWrapper _(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, "a"); // $ExpectType LoDashImplicitWrapper @@ -127,10 +130,10 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.chain(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); // $ExpectType LoDashExplicitWrapper - _.chain(list).differenceBy(arrayParam, iteratee); // $ExpectType LoDashExplicitWrapper - _.chain(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); // $ExpectType LoDashExplicitWrapper + _.chain(list).differenceBy(arrayParam, valueIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, valueIterator); // $ExpectType LoDashExplicitWrapper // $ExpectType LoDashExplicitWrapper - _.chain(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, iteratee); + _.chain(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, valueIterator); _.chain(list).differenceBy(arrayParam, "a"); // $ExpectType LoDashExplicitWrapper _.chain(list).differenceBy(arrayParam, listParam, arrayParam, listParam, arrayParam, "a"); // $ExpectType LoDashExplicitWrapper @@ -142,8 +145,8 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.chain(list).differenceBy(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, {a: 1}); - fp.differenceBy(iteratee, list, arrayParam); // $ExpectType AbcObject[] - fp.differenceBy(iteratee)(list)(listParam); // $ExpectType AbcObject[] + fp.differenceBy(valueIterator, list, arrayParam); // $ExpectType AbcObject[] + fp.differenceBy(valueIterator)(list)(listParam); // $ExpectType AbcObject[] fp.differenceBy("a", list, arrayParam); // $ExpectType AbcObject[] fp.differenceBy({a: 1}, list, arrayParam); // $ExpectType AbcObject[] @@ -188,21 +191,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper { - value; // $ExpectType T1 | T2 | T3 - return 0; - }); - // $ExpectType T1[] - _.differenceBy([t1], [t2], [t3], [t4], (value) => { - value; // $ExpectType T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType T1[] - _.differenceBy([t1], [t2], [t3], [t4], [""], (value) => { - value; // $ExpectType string | T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType T1[] _.differenceBy([t1], [t2], [t3], [t4], [""], [42], (value) => { value; // $ExpectType string | number | T1 | T2 | T3 | T4 return 0; @@ -226,21 +214,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper - _([t1]).differenceBy([t2], [t3], (value) => { - value; // $ExpectType T1 | T2 | T3 - return 0; - }); - // $ExpectType LoDashImplicitWrapper - _([t1]).differenceBy([t2], [t3], [t4], (value) => { - value; // $ExpectType T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType LoDashImplicitWrapper - _([t1]).differenceBy([t2], [t3], [t4], [""], (value) => { - value; // $ExpectType string | T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType LoDashImplicitWrapper _([t1]).differenceBy([t2], [t3], [t4], [""], [42], (value) => { value; // $ExpectType string | number | T1 | T2 | T3 | T4 return 0; @@ -264,21 +237,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper - _.chain([t1]).differenceBy([t2], [t3], (value) => { - value; // $ExpectType T1 | T2 | T3 - return 0; - }); - // $ExpectType LoDashExplicitWrapper - _.chain([t1]).differenceBy([t2], [t3], [t4], (value) => { - value; // $ExpectType T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType LoDashExplicitWrapper - _.chain([t1]).differenceBy([t2], [t3], [t4], [""], (value) => { - value; // $ExpectType string | T1 | T2 | T3 | T4 - return 0; - }); - // $ExpectType LoDashExplicitWrapper _.chain([t1]).differenceBy([t2], [t3], [t4], [""], [42], (value) => { value; // $ExpectType string | number | T1 | T2 | T3 | T4 return 0; @@ -292,24 +250,13 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = [] as any; - const arrayParam: AbcObject[] = []; - const listParam: _.List = []; - const comparator = (a: AbcObject, b: AbcObject) => true; - _.differenceWith(list); // $ExpectType AbcObject[] - _.differenceWith(list, arrayParam); // $ExpectType AbcObject[] - _.differenceWith(list, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); // $ExpectType AbcObject[] _.differenceWith(list, arrayParam, comparator); // $ExpectType AbcObject[] _.differenceWith(list, listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); // $ExpectType AbcObject[] - _(list).differenceWith(arrayParam); // $ExpectType LoDashImplicitWrapper - _(list).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); // $ExpectType LoDashImplicitWrapper _(list).differenceWith(arrayParam, comparator); // $ExpectType LoDashImplicitWrapper _(list).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); // $ExpectType LoDashImplicitWrapper - _.chain(list).differenceWith(arrayParam); // $ExpectType LoDashExplicitWrapper - _.chain(list).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam); // $ExpectType LoDashExplicitWrapper _.chain(list).differenceWith(arrayParam, comparator); // $ExpectType LoDashExplicitWrapper _.chain(list).differenceWith(listParam, arrayParam, listParam, arrayParam, listParam, arrayParam, comparator); // $ExpectType LoDashExplicitWrapper @@ -359,8 +306,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.drop(list); // $ExpectType AbcObject[] _.drop(list, 42); // $ExpectType AbcObject[] _(list).drop(42); // $ExpectType LoDashImplicitWrapper @@ -381,145 +326,132 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const predicateFn = (value: AbcObject, index: number, collection: _.List) => true; - const predicateFn2 = (value: AbcObject) => true; - _.dropWhile(list); // $ExpectType AbcObject[] - _.dropWhile(list, predicateFn); // $ExpectType AbcObject[] + _.dropWhile(list, listIterator); // $ExpectType AbcObject[] _.dropWhile(list, ""); // $ExpectType AbcObject[] _.dropWhile(list, {a: 42}); // $ExpectType AbcObject[] _(list).dropWhile(); // $ExpectType LoDashImplicitWrapper - _(list).dropWhile(predicateFn); // $ExpectType LoDashImplicitWrapper + _(list).dropWhile(listIterator); // $ExpectType LoDashImplicitWrapper _(list).dropWhile(""); // $ExpectType LoDashImplicitWrapper _(list).dropWhile({a: 42}); // $ExpectType LoDashImplicitWrapper _.chain(list).dropWhile(); // $ExpectType LoDashExplicitWrapper - _.chain(list).dropWhile(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).dropWhile(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).dropWhile(""); // $ExpectType LoDashExplicitWrapper _.chain(list).dropWhile({a: 42}); // $ExpectType LoDashExplicitWrapper - fp.dropWhile(predicateFn2, list); // $ExpectType AbcObject[] - fp.dropWhile(predicateFn2)(list); // $ExpectType AbcObject[] + fp.dropWhile(valueIterator, list); // $ExpectType AbcObject[] + fp.dropWhile(valueIterator)(list); // $ExpectType AbcObject[] fp.dropWhile("", list); // $ExpectType AbcObject[] fp.dropWhile({ a: 42 }, list); // $ExpectType AbcObject[] _.dropRightWhile(list); // $ExpectType AbcObject[] - _.dropRightWhile(list, predicateFn); // $ExpectType AbcObject[] + _.dropRightWhile(list, listIterator); // $ExpectType AbcObject[] _.dropRightWhile(list, ""); // $ExpectType AbcObject[] _.dropRightWhile(list, {a: 42}); // $ExpectType AbcObject[] _(list).dropRightWhile(); // $ExpectType LoDashImplicitWrapper - _(list).dropRightWhile(predicateFn); // $ExpectType LoDashImplicitWrapper + _(list).dropRightWhile(listIterator); // $ExpectType LoDashImplicitWrapper _(list).dropRightWhile(""); // $ExpectType LoDashImplicitWrapper _(list).dropRightWhile({a: 42}); // $ExpectType LoDashImplicitWrapper _.chain(list).dropRightWhile(); // $ExpectType LoDashExplicitWrapper - _.chain(list).dropRightWhile(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).dropRightWhile(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).dropRightWhile(""); // $ExpectType LoDashExplicitWrapper _.chain(list).dropRightWhile({a: 42}); // $ExpectType LoDashExplicitWrapper - fp.dropRightWhile(predicateFn2, list); // $ExpectType AbcObject[] - fp.dropRightWhile(predicateFn2)(list); // $ExpectType AbcObject[] + fp.dropRightWhile(valueIterator, list); // $ExpectType AbcObject[] + fp.dropRightWhile(valueIterator)(list); // $ExpectType AbcObject[] fp.dropRightWhile("", list); // $ExpectType AbcObject[] fp.dropRightWhile({ a: 42 }, list); // $ExpectType AbcObject[] } // _.fill { - const array: number[] | null | undefined = anything; - const list: _.List | null | undefined = anything; + _.fill(array, abcObject); // $ExpectType AbcObject[] + _.fill(array, abcObject, 0); // $ExpectType AbcObject[] + _.fill(array, abcObject, 0, 10); // $ExpectType AbcObject[] - _.fill(array, 42); // $ExpectType number[] - _.fill(array, 42, 0); // $ExpectType number[] - _.fill(array, 42, 0, 10); // $ExpectType number[] + _.fill(list, abcObject); // $ExpectType ArrayLike + _.fill(list, abcObject, 0); // $ExpectType ArrayLike + _.fill(list, abcObject, 0, 10); // $ExpectType ArrayLike - _.fill(list, 42); // $ExpectType ArrayLike - _.fill(list, 42, 0); // $ExpectType ArrayLike - _.fill(list, 42, 0, 10); // $ExpectType ArrayLike + _(list).fill(abcObject); // $ExpectType LoDashImplicitWrapper> + _(list).fill(abcObject, 0); // $ExpectType LoDashImplicitWrapper> + _(list).fill(abcObject, 0, 10); // $ExpectType LoDashImplicitWrapper> - _(list).fill(42); // $ExpectType LoDashImplicitWrapper> - _(list).fill(42, 0); // $ExpectType LoDashImplicitWrapper> - _(list).fill(42, 0, 10); // $ExpectType LoDashImplicitWrapper> + _.chain(list).fill(abcObject); // $ExpectType LoDashExplicitWrapper> + _.chain(list).fill(abcObject, 0); // $ExpectType LoDashExplicitWrapper> + _.chain(list).fill(abcObject, 0, 10); // $ExpectType LoDashExplicitWrapper> - _.chain(list).fill(42); // $ExpectType LoDashExplicitWrapper> - _.chain(list).fill(42, 0); // $ExpectType LoDashExplicitWrapper> - _.chain(list).fill(42, 0, 10); // $ExpectType LoDashExplicitWrapper> - - fp.fill(0, 10, 42, array); // $ExpectType number[] - fp.fill(0)(10)(42)(array); // $ExpectType number[] - fp.fill(0, 10, 42, list); // $ExpectType ArrayLike + fp.fill(0, 10, abcObject, array); // $ExpectType AbcObject[] + fp.fill(0)(10)(abcObject)(array); // $ExpectType AbcObject[] + fp.fill(0, 10, abcObject, list); // $ExpectType ArrayLike } // _.findIndex // _.findLastIndex { - const list: _.List | null | undefined = anything; - const predicateFn = (value: AbcObject, index: number, collection: _.List) => true; - const predicateFn2 = (value: AbcObject) => true; - _.findIndex(list); // $ExpectType number - _.findIndex(list, predicateFn); // $ExpectType number + _.findIndex(list, listIterator); // $ExpectType number _.findIndex(list, ""); // $ExpectType number _.findIndex(list, {a: 42}); // $ExpectType number - _.findIndex(list, predicateFn, 1); // $ExpectType number + _.findIndex(list, listIterator, 1); // $ExpectType number _(list).findIndex(); // $ExpectType number - _(list).findIndex(predicateFn); // $ExpectType number + _(list).findIndex(listIterator); // $ExpectType number _(list).findIndex(""); // $ExpectType number _(list).findIndex<{a: number}>({a: 42}); // $ExpectType number - _(list).findIndex(predicateFn, 1); // $ExpectType number + _(list).findIndex(listIterator, 1); // $ExpectType number _.chain(list).findIndex(); // $ExpectType LoDashExplicitWrapper - _.chain(list).findIndex(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).findIndex(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).findIndex(""); // $ExpectType LoDashExplicitWrapper _.chain(list).findIndex<{a: number}>({a: 42}); // $ExpectType LoDashExplicitWrapper - _.chain(list).findIndex(predicateFn, 1); // $ExpectType LoDashExplicitWrapper + _.chain(list).findIndex(listIterator, 1); // $ExpectType LoDashExplicitWrapper - fp.findIndex(predicateFn2, list); // $ExpectType number - fp.findIndex(predicateFn2)(list); // $ExpectType number + fp.findIndex(valueIterator, list); // $ExpectType number + fp.findIndex(valueIterator)(list); // $ExpectType number fp.findIndex("", list); // $ExpectType number fp.findIndex({ a: 42 }, list); // $ExpectType number - fp.findIndexFrom(predicateFn2, 1, list); // $ExpectType number - fp.findIndexFrom(predicateFn2)(1)(list); // $ExpectType number + fp.findIndexFrom(valueIterator, 1, list); // $ExpectType number + fp.findIndexFrom(valueIterator)(1)(list); // $ExpectType number fp.findIndexFrom("", 1, list); // $ExpectType number fp.findIndexFrom({ a: 42 }, 1, list); // $ExpectType number _.findLastIndex(list); // $ExpectType number - _.findLastIndex(list, predicateFn); // $ExpectType number + _.findLastIndex(list, listIterator); // $ExpectType number _.findLastIndex(list, ""); // $ExpectType number _.findLastIndex(list, {a: 42}); // $ExpectType number - _.findLastIndex(list, predicateFn, 1); // $ExpectType number + _.findLastIndex(list, listIterator, 1); // $ExpectType number _(list).findLastIndex(); // $ExpectType number - _(list).findLastIndex(predicateFn); // $ExpectType number + _(list).findLastIndex(listIterator); // $ExpectType number _(list).findLastIndex(""); // $ExpectType number _(list).findLastIndex<{a: number}>({a: 42}); // $ExpectType number - _(list).findLastIndex(predicateFn, 1); // $ExpectType number + _(list).findLastIndex(listIterator, 1); // $ExpectType number _.chain(list).findLastIndex(); // $ExpectType LoDashExplicitWrapper - _.chain(list).findLastIndex(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).findLastIndex(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).findLastIndex(""); // $ExpectType LoDashExplicitWrapper _.chain(list).findLastIndex<{a: number}>({a: 42}); // $ExpectType LoDashExplicitWrapper - _.chain(list).findLastIndex(predicateFn, 1); // $ExpectType LoDashExplicitWrapper + _.chain(list).findLastIndex(listIterator, 1); // $ExpectType LoDashExplicitWrapper - fp.findLastIndex(predicateFn2, list); // $ExpectType number - fp.findLastIndex(predicateFn2)(list); // $ExpectType number + fp.findLastIndex(valueIterator, list); // $ExpectType number + fp.findLastIndex(valueIterator)(list); // $ExpectType number fp.findLastIndex("", list); // $ExpectType number fp.findLastIndex({ a: 42 }, list); // $ExpectType number - fp.findLastIndexFrom(predicateFn2, 1, list); // $ExpectType number - fp.findLastIndexFrom(predicateFn2)(1)(list); // $ExpectType number + fp.findLastIndexFrom(valueIterator, 1, list); // $ExpectType number + fp.findLastIndexFrom(valueIterator)(1)(list); // $ExpectType number fp.findLastIndexFrom("", 1, list); // $ExpectType number fp.findLastIndexFrom({ a: 42 }, 1, list); // $ExpectType number } // _.first { - const list: _.List | null | undefined = anything; - _.first("abc"); // $ExpectType string | undefined _.first(list); // $ExpectType AbcObject | undefined @@ -590,8 +522,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.head("abc"); // $ExpectType string | undefined _.head(list); // $ExpectType AbcObject | undefined @@ -610,46 +540,41 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const value: AbcObject = { a: 1, b: "", c: true }; + _.indexOf(list, abcObject); // $ExpectType number + _.indexOf(list, abcObject, 42); // $ExpectType number + _(list).indexOf(abcObject); // $ExpectType number + _(list).indexOf(abcObject, 42); // $ExpectType number + _.chain(list).indexOf(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(list).indexOf(abcObject, 42); // $ExpectType LoDashExplicitWrapper + fp.indexOf(abcObject, list); // $ExpectType number + fp.indexOf(abcObject)(list); // $ExpectType number + fp.indexOfFrom(abcObject)(42)(list); // $ExpectType number - _.indexOf(list, value); // $ExpectType number - _.indexOf(list, value, 42); // $ExpectType number - _(list).indexOf(value); // $ExpectType number - _(list).indexOf(value, 42); // $ExpectType number - _.chain(list).indexOf(value); // $ExpectType LoDashExplicitWrapper - _.chain(list).indexOf(value, 42); // $ExpectType LoDashExplicitWrapper - fp.indexOf(value, list); // $ExpectType number - fp.indexOf(value)(list); // $ExpectType number - fp.indexOfFrom(value)(42)(list); // $ExpectType number + _.lastIndexOf(list, abcObject); // $ExpectType number + _.lastIndexOf(list, abcObject, 42); // $ExpectType number + _(list).lastIndexOf(abcObject); // $ExpectType number + _(list).lastIndexOf(abcObject, 42); // $ExpectType number + _.chain(list).lastIndexOf(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(list).lastIndexOf(abcObject, 42); // $ExpectType LoDashExplicitWrapper + fp.lastIndexOf(abcObject, list); // $ExpectType number + fp.lastIndexOf(abcObject)(list); // $ExpectType number + fp.lastIndexOfFrom(abcObject)(42)(list); // $ExpectType number - _.lastIndexOf(list, value); // $ExpectType number - _.lastIndexOf(list, value, 42); // $ExpectType number - _(list).lastIndexOf(value); // $ExpectType number - _(list).lastIndexOf(value, 42); // $ExpectType number - _.chain(list).lastIndexOf(value); // $ExpectType LoDashExplicitWrapper - _.chain(list).lastIndexOf(value, 42); // $ExpectType LoDashExplicitWrapper - fp.lastIndexOf(value, list); // $ExpectType number - fp.lastIndexOf(value)(list); // $ExpectType number - fp.lastIndexOfFrom(value)(42)(list); // $ExpectType number + _.sortedIndexOf(list, abcObject); // $ExpectType number + _(list).sortedIndexOf(abcObject); // $ExpectType number + _.chain(list).indexOf(abcObject); // $ExpectType LoDashExplicitWrapper + fp.sortedIndexOf(abcObject, list); // $ExpectType number + fp.sortedIndexOf(abcObject)(list); // $ExpectType number - _.sortedIndexOf(list, value); // $ExpectType number - _(list).sortedIndexOf(value); // $ExpectType number - _.chain(list).indexOf(value); // $ExpectType LoDashExplicitWrapper - fp.sortedIndexOf(value, list); // $ExpectType number - fp.sortedIndexOf(value)(list); // $ExpectType number - - _.sortedLastIndexOf(list, value); // $ExpectType number - _(list).sortedLastIndexOf(value); // $ExpectType number - _.chain(list).sortedLastIndexOf(value); // $ExpectType LoDashExplicitWrapper - fp.sortedLastIndexOf(value, list); // $ExpectType number - fp.sortedLastIndexOf(value)(list); // $ExpectType number + _.sortedLastIndexOf(list, abcObject); // $ExpectType number + _(list).sortedLastIndexOf(abcObject); // $ExpectType number + _.chain(list).sortedLastIndexOf(abcObject); // $ExpectType LoDashExplicitWrapper + fp.sortedLastIndexOf(abcObject, list); // $ExpectType number + fp.sortedLastIndexOf(abcObject)(list); // $ExpectType number } // _.initial { - const list: _.List | null | undefined = anything; - _.initial(list); // $ExpectType AbcObject[] _(list).initial(); // $ExpectType LoDashImplicitWrapper _.chain(list).initial(); // $ExpectType LoDashExplicitWrapper @@ -840,8 +765,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.last("abc"); // $ExpectType string | undefined _.last(list); // $ExpectType AbcObject | undefined @@ -857,8 +780,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.nth(list, 42); // $ExpectType AbcObject | undefined _(list).nth(42); // $ExpectType AbcObject | undefined _.chain(list).nth(42); // $ExpectType LoDashExplicitWrapper @@ -871,32 +792,30 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper = []; - const value: AbcObject = { a: 1, b: "", c: true }; _.pull(array); // $ExpectType AbcObject[] - _.pull(array, value); // $ExpectType AbcObject[] - _.pull(array, value, value, value); // $ExpectType AbcObject[] + _.pull(array, abcObject); // $ExpectType AbcObject[] + _.pull(array, abcObject, abcObject, abcObject); // $ExpectType AbcObject[] _.pull(list); // $ExpectType ArrayLike - _.pull(list, value); // $ExpectType ArrayLike - _.pull(list, value, value, value); // $ExpectType ArrayLike + _.pull(list, abcObject); // $ExpectType ArrayLike + _.pull(list, abcObject, abcObject, abcObject); // $ExpectType ArrayLike _(array).pull(); // $ExpectType LoDashImplicitWrapper - _(array).pull(value); // $ExpectType LoDashImplicitWrapper - _(array).pull(value, value, value); // $ExpectType LoDashImplicitWrapper + _(array).pull(abcObject); // $ExpectType LoDashImplicitWrapper + _(array).pull(abcObject, abcObject, abcObject); // $ExpectType LoDashImplicitWrapper _(list).pull(); // $ExpectType LoDashImplicitWrapper> - _(list).pull(value); // $ExpectType LoDashImplicitWrapper> - _(list).pull(value, value, value); // $ExpectType LoDashImplicitWrapper> + _(list).pull(abcObject); // $ExpectType LoDashImplicitWrapper> + _(list).pull(abcObject, abcObject, abcObject); // $ExpectType LoDashImplicitWrapper> _.chain(array).pull(); // $ExpectType LoDashExplicitWrapper - _.chain(array).pull(value); // $ExpectType LoDashExplicitWrapper - _.chain(array).pull(value, value, value); // $ExpectType LoDashExplicitWrapper + _.chain(array).pull(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(array).pull(abcObject, abcObject, abcObject); // $ExpectType LoDashExplicitWrapper _.chain(list).pull(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).pull(value); // $ExpectType LoDashExplicitWrapper> - _.chain(list).pull(value, value, value); // $ExpectType LoDashExplicitWrapper> + _.chain(list).pull(abcObject); // $ExpectType LoDashExplicitWrapper> + _.chain(list).pull(abcObject, abcObject, abcObject); // $ExpectType LoDashExplicitWrapper> - fp.pull(value, array); // $ExpectType AbcObject[] - fp.pull(value, list); // $ExpectType ArrayLike - fp.pull(value)(list); // $ExpectType ArrayLike + fp.pull(abcObject, array); // $ExpectType AbcObject[] + fp.pull(abcObject)(list); // $ExpectType ArrayLike } // _.pullAt @@ -1137,34 +1056,30 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper = []; - const predicateFn = (value: AbcObject, index: number, collection: _.List) => true; _.remove(list); // $ExpectType AbcObject[] - _.remove(list, predicateFn); // $ExpectType AbcObject[] + _.remove(list, listIterator); // $ExpectType AbcObject[] _.remove(list, ""); // $ExpectType AbcObject[] _.remove(list, { a: 42 }); // $ExpectType AbcObject[] _(list).remove(); // $ExpectType LoDashImplicitWrapper - _(list).remove(predicateFn); // $ExpectType LoDashImplicitWrapper + _(list).remove(listIterator); // $ExpectType LoDashImplicitWrapper _(list).remove(""); // $ExpectType LoDashImplicitWrapper _(list).remove({ a: 42 }); // $ExpectType LoDashImplicitWrapper _.chain(list).remove(); // $ExpectType LoDashExplicitWrapper - _.chain(list).remove(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).remove(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).remove(""); // $ExpectType LoDashExplicitWrapper _.chain(list).remove({ a: 42 }); // $ExpectType LoDashExplicitWrapper - const predicateFn2 = (value: AbcObject) => true; - fp.remove(predicateFn2, list); // $ExpectType AbcObject[] - fp.remove(predicateFn2)(list); // $ExpectType AbcObject[] + fp.remove(valueIterator, list); // $ExpectType AbcObject[] + fp.remove(valueIterator)(list); // $ExpectType AbcObject[] fp.remove("", list); // $ExpectType AbcObject[] fp.remove({ a: 42 }, list); // $ExpectType AbcObject[] } // _.tail { - const list: _.List | null | undefined = anything; - _.tail(list); // $ExpectType AbcObject[] _(list).tail(); // $ExpectType LoDashImplicitWrapper _.chain(list).tail(); // $ExpectType LoDashExplicitWrapper @@ -1173,8 +1088,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const value: AbcObject = { a: 1, b: "", c: true }; - const listIterator = (value: AbcObject) => 0; + _.sortedIndexBy(list, abcObject, valueIterator); // $ExpectType number + _.sortedIndexBy(list, abcObject, ""); // $ExpectType number + _.sortedIndexBy(list, abcObject, { a: 42 }); // $ExpectType number + _(list).sortedIndexBy(abcObject, valueIterator); // $ExpectType number + _(list).sortedIndexBy(abcObject, ""); // $ExpectType number + _(list).sortedIndexBy(abcObject, { a: 42 }); // $ExpectType number + _.chain(list).sortedIndexBy(abcObject, valueIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedIndexBy(abcObject, ""); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedIndexBy(abcObject, { a: 42 }); // $ExpectType LoDashExplicitWrapper + fp.sortedIndexBy(valueIterator, abcObject, list); // $ExpectType number + fp.sortedIndexBy(valueIterator)(abcObject)(list); // $ExpectType number + fp.sortedIndexBy("a", abcObject, list); // $ExpectType number + fp.sortedIndexBy({ a: 42 }, abcObject, list); // $ExpectType number - _.sortedIndexBy(list, value, listIterator); // $ExpectType number - _.sortedIndexBy(list, value, ""); // $ExpectType number - _.sortedIndexBy(list, value, { a: 42 }); // $ExpectType number - _(list).sortedIndexBy(value, listIterator); // $ExpectType number - _(list).sortedIndexBy(value, ""); // $ExpectType number - _(list).sortedIndexBy(value, { a: 42 }); // $ExpectType number - _.chain(list).sortedIndexBy(value, listIterator); // $ExpectType LoDashExplicitWrapper - _.chain(list).sortedIndexBy(value, ""); // $ExpectType LoDashExplicitWrapper - _.chain(list).sortedIndexBy(value, { a: 42 }); // $ExpectType LoDashExplicitWrapper - fp.sortedIndexBy(listIterator, value, list); // $ExpectType number - fp.sortedIndexBy(listIterator)(value)(list); // $ExpectType number - fp.sortedIndexBy("a", value, list); // $ExpectType number - fp.sortedIndexBy({ a: 42 }, value, list); // $ExpectType number - - _.sortedLastIndexBy(list, value, listIterator); // $ExpectType number - _.sortedLastIndexBy(list, value, ""); // $ExpectType number - _.sortedLastIndexBy(list, value, { a: 42 }); // $ExpectType number - _(list).sortedLastIndexBy(value, listIterator); // $ExpectType number - _(list).sortedLastIndexBy(value, ""); // $ExpectType number - _(list).sortedLastIndexBy(value, { a: 42 }); // $ExpectType number - _.chain(list).sortedLastIndexBy(value, listIterator); // $ExpectType LoDashExplicitWrapper - _.chain(list).sortedLastIndexBy(value, ""); // $ExpectType LoDashExplicitWrapper - _.chain(list).sortedLastIndexBy(value, { a: 42 }); // $ExpectType LoDashExplicitWrapper - fp.sortedLastIndexBy(listIterator, value, list); // $ExpectType number - fp.sortedLastIndexBy(listIterator)(value)(list); // $ExpectType number - fp.sortedLastIndexBy("a", value, list); // $ExpectType number - fp.sortedLastIndexBy({ a: 42 }, value, list); // $ExpectType number + _.sortedLastIndexBy(list, abcObject, valueIterator); // $ExpectType number + _.sortedLastIndexBy(list, abcObject, ""); // $ExpectType number + _.sortedLastIndexBy(list, abcObject, { a: 42 }); // $ExpectType number + _(list).sortedLastIndexBy(abcObject, valueIterator); // $ExpectType number + _(list).sortedLastIndexBy(abcObject, ""); // $ExpectType number + _(list).sortedLastIndexBy(abcObject, { a: 42 }); // $ExpectType number + _.chain(list).sortedLastIndexBy(abcObject, valueIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedLastIndexBy(abcObject, ""); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedLastIndexBy(abcObject, { a: 42 }); // $ExpectType LoDashExplicitWrapper + fp.sortedLastIndexBy(valueIterator, abcObject, list); // $ExpectType number + fp.sortedLastIndexBy(valueIterator)(abcObject)(list); // $ExpectType number + fp.sortedLastIndexBy("a", abcObject, list); // $ExpectType number + fp.sortedLastIndexBy({ a: 42 }, abcObject, list); // $ExpectType number } // _.sortedIndex // _.sortedLastIndex { - const list: _.List | null | undefined = anything; - const value: AbcObject = { a: 1, b: "", c: true }; + _.sortedIndex(list, abcObject); // $ExpectType number + _(list).sortedIndex(abcObject); // $ExpectType number + _.chain(list).sortedIndex(abcObject); // $ExpectType LoDashExplicitWrapper + fp.sortedIndex(abcObject, list); // $ExpectType number + fp.sortedIndex(abcObject)(list); // $ExpectType number - _.sortedIndex(list, value); // $ExpectType number - _(list).sortedIndex(value); // $ExpectType number - _.chain(list).sortedIndex(value); // $ExpectType LoDashExplicitWrapper - fp.sortedIndex(value, list); // $ExpectType number - fp.sortedIndex(value)(list); // $ExpectType number - - _.sortedLastIndex(list, value); // $ExpectType number - _(list).sortedLastIndex(value); // $ExpectType number - _.chain(list).sortedLastIndex(value); // $ExpectType LoDashExplicitWrapper - fp.sortedLastIndex(value, list); // $ExpectType number - fp.sortedLastIndex(value)(list); // $ExpectType number + _.sortedLastIndex(list, abcObject); // $ExpectType number + _(list).sortedLastIndex(abcObject); // $ExpectType number + _.chain(list).sortedLastIndex(abcObject); // $ExpectType LoDashExplicitWrapper + fp.sortedLastIndex(abcObject, list); // $ExpectType number + fp.sortedLastIndex(abcObject)(list); // $ExpectType number } // _.take // _.takeRight { - const list: _.List | null | undefined = anything; - _.take(list); // $ExpectType AbcObject[] _.take(list, 42); // $ExpectType AbcObject[] _(list).take(); // $ExpectType LoDashImplicitWrapper @@ -1269,55 +1173,49 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const predicateFn = (value: AbcObject, index: number, collection: _.List) => true; - const predicateFn2 = (value: AbcObject) => true; - _.takeWhile(list); // $ExpectType AbcObject[] - _.takeWhile(list, predicateFn); // $ExpectType AbcObject[] + _.takeWhile(list, listIterator); // $ExpectType AbcObject[] _.takeWhile(list, ""); // $ExpectType AbcObject[] _.takeWhile(list, { a: 42 }); // $ExpectType AbcObject[] _(list).takeWhile(); // $ExpectType LoDashImplicitWrapper - _(list).takeWhile(predicateFn); // $ExpectType LoDashImplicitWrapper + _(list).takeWhile(listIterator); // $ExpectType LoDashImplicitWrapper _(list).takeWhile(""); // $ExpectType LoDashImplicitWrapper _(list).takeWhile({ a: 42 }); // $ExpectType LoDashImplicitWrapper _.chain(list).takeWhile(); // $ExpectType LoDashExplicitWrapper - _.chain(list).takeWhile(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).takeWhile(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).takeWhile(""); // $ExpectType LoDashExplicitWrapper _.chain(list).takeWhile({ a: 42 }); // $ExpectType LoDashExplicitWrapper - fp.takeWhile(predicateFn2, list); // $ExpectType AbcObject[] - fp.takeWhile(predicateFn2)(list); // $ExpectType AbcObject[] + fp.takeWhile(valueIterator, list); // $ExpectType AbcObject[] + fp.takeWhile(valueIterator)(list); // $ExpectType AbcObject[] fp.takeWhile("a", list); // $ExpectType AbcObject[] fp.takeWhile({ a: 42 }, list); // $ExpectType AbcObject[] _.takeRightWhile(list); // $ExpectType AbcObject[] - _.takeRightWhile(list, predicateFn); // $ExpectType AbcObject[] + _.takeRightWhile(list, listIterator); // $ExpectType AbcObject[] _.takeRightWhile(list, ""); // $ExpectType AbcObject[] _.takeRightWhile(list, { a: 42 }); // $ExpectType AbcObject[] _(list).takeRightWhile(); // $ExpectType LoDashImplicitWrapper - _(list).takeRightWhile(predicateFn); // $ExpectType LoDashImplicitWrapper + _(list).takeRightWhile(listIterator); // $ExpectType LoDashImplicitWrapper _(list).takeRightWhile(""); // $ExpectType LoDashImplicitWrapper _(list).takeRightWhile({ a: 42 }); // $ExpectType LoDashImplicitWrapper _.chain(list).takeRightWhile(); // $ExpectType LoDashExplicitWrapper - _.chain(list).takeRightWhile(predicateFn); // $ExpectType LoDashExplicitWrapper + _.chain(list).takeRightWhile(listIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).takeRightWhile(""); // $ExpectType LoDashExplicitWrapper _.chain(list).takeRightWhile({ a: 42 }); // $ExpectType LoDashExplicitWrapper - fp.takeRightWhile(predicateFn2, list); // $ExpectType AbcObject[] - fp.takeRightWhile(predicateFn2)(list); // $ExpectType AbcObject[] + fp.takeRightWhile(valueIterator, list); // $ExpectType AbcObject[] + fp.takeRightWhile(valueIterator)(list); // $ExpectType AbcObject[] fp.takeRightWhile("a", list); // $ExpectType AbcObject[] fp.takeRightWhile({ a: 42 }, list); // $ExpectType AbcObject[] } // _.union { - const list: _.List | null | undefined = anything; - _.union(list); // $ExpectType AbcObject[] _.union(list, list); // $ExpectType AbcObject[] _.union(list, list, list); // $ExpectType AbcObject[] @@ -1336,13 +1234,9 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const iteratee = (value: AbcObject) => 1; - _.unionBy(list, list); // $ExpectType AbcObject[] - _.unionBy(list, list, list, list, list, list); // $ExpectType AbcObject[] - _.unionBy(list, list, iteratee); // $ExpectType AbcObject[] - _.unionBy(list, list, list, list, list, list, iteratee); // $ExpectType AbcObject[] + _.unionBy(list, list, valueIterator); // $ExpectType AbcObject[] + _.unionBy(list, list, list, list, list, list, valueIterator); // $ExpectType AbcObject[] _.unionBy(list, list, "a"); // $ExpectType AbcObject[] // param needed for TS 2.3 _.unionBy(list, list, list, list, list, list, "a"); // $ExpectType AbcObject[] @@ -1350,9 +1244,8 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper - _(list).unionBy(list, list, list, list, list); // $ExpectType LoDashImplicitWrapper - _(list).unionBy(list, iteratee); // $ExpectType LoDashImplicitWrapper - _(list).unionBy(list, list, list, list, list, iteratee); // $ExpectType LoDashImplicitWrapper + _(list).unionBy(list, valueIterator); // $ExpectType LoDashImplicitWrapper + _(list).unionBy(list, list, list, list, list, valueIterator); // $ExpectType LoDashImplicitWrapper _(list).unionBy(list, "a"); // $ExpectType LoDashImplicitWrapper // param needed for TS 2.3 _(list).unionBy(list, list, list, list, list, "a"); // $ExpectType LoDashImplicitWrapper @@ -1360,17 +1253,16 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.chain(list).unionBy(list); // $ExpectType LoDashExplicitWrapper - _.chain(list).unionBy(list, list, list, list, list); // $ExpectType LoDashExplicitWrapper - _.chain(list).unionBy(list, iteratee); // $ExpectType LoDashExplicitWrapper - _.chain(list).unionBy(list, list, list, list, list, iteratee); // $ExpectType LoDashExplicitWrapper + _.chain(list).unionBy(list, valueIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).unionBy(list, list, list, list, list, valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).unionBy(list, "a"); // $ExpectType LoDashExplicitWrapper // param needed for TS 2.3 _.chain(list).unionBy(list, list, list, list, list, "a"); // $ExpectType LoDashExplicitWrapper _.chain(list).unionBy(list, {a: 1}); // $ExpectType LoDashExplicitWrapper _.chain(list).unionBy(list, list, list, list, list, {a: 1}); // $ExpectType LoDashExplicitWrapper - fp.unionBy(iteratee, list, list); // $ExpectType AbcObject[] - fp.unionBy(iteratee)(list)(list); // $ExpectType AbcObject[] + fp.unionBy(valueIterator, list, list); // $ExpectType AbcObject[] + fp.unionBy(valueIterator)(list)(list); // $ExpectType AbcObject[] fp.unionBy("a", list, list); // $ExpectType AbcObject[] fp.unionBy({ a: 1 }, list, list); // $ExpectType AbcObject[] } @@ -1378,8 +1270,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.uniq("abc"); // $ExpectType string[] _.uniq(list); // $ExpectType AbcObject[] _(list).uniq(); // $ExpectType LoDashImplicitWrapper @@ -1398,10 +1288,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const stringIterator = (value: string) => ""; - const valueIterator = (value: AbcObject) => 0; - _.uniqBy("abc", stringIterator); // $ExpectType string[] _.uniqBy(list, valueIterator); // $ExpectType AbcObject[] _.uniqBy(list, "a"); // $ExpectType AbcObject[] @@ -1495,8 +1381,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - _.xor(list); // $ExpectType AbcObject[] _.xor(list, list); // $ExpectType AbcObject[] _.xor(list, list, list); // $ExpectType AbcObject[] @@ -1515,13 +1399,9 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const iteratee = (value: AbcObject) => 1; - _.xorBy(list, list); // $ExpectType AbcObject[] - _.xorBy(list, list, list, list, list, list); // $ExpectType AbcObject[] - _.xorBy(list, list, iteratee); // $ExpectType AbcObject[] - _.xorBy(list, list, list, list, list, list, iteratee); // $ExpectType AbcObject[] + _.xorBy(list, list, valueIterator); // $ExpectType AbcObject[] + _.xorBy(list, list, list, list, list, list, valueIterator); // $ExpectType AbcObject[] _.xorBy(list, list, "a"); // $ExpectType AbcObject[] // param needed for TS 2.3 _.xorBy(list, list, list, list, list, list, "a"); // $ExpectType AbcObject[] @@ -1529,9 +1409,8 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper - _(list).xorBy(list, list, list, list, list); // $ExpectType LoDashImplicitWrapper - _(list).xorBy(list, iteratee); // $ExpectType LoDashImplicitWrapper - _(list).xorBy(list, list, list, list, list, iteratee); // $ExpectType LoDashImplicitWrapper + _(list).xorBy(list, valueIterator); // $ExpectType LoDashImplicitWrapper + _(list).xorBy(list, list, list, list, list, valueIterator); // $ExpectType LoDashImplicitWrapper _(list).xorBy(list, "a"); // $ExpectType LoDashImplicitWrapper // param needed for TS 2.3 _(list).xorBy(list, list, list, list, list, "a"); // $ExpectType LoDashImplicitWrapper @@ -1539,25 +1418,22 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper _.chain(list).xorBy(list); // $ExpectType LoDashExplicitWrapper - _.chain(list).xorBy(list, list, list, list, list); // $ExpectType LoDashExplicitWrapper - _.chain(list).xorBy(list, iteratee); // $ExpectType LoDashExplicitWrapper - _.chain(list).xorBy(list, list, list, list, list, iteratee); // $ExpectType LoDashExplicitWrapper + _.chain(list).xorBy(list, valueIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).xorBy(list, list, list, list, list, valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).xorBy(list, "a"); // $ExpectType LoDashExplicitWrapper // param needed for TS 2.3 _.chain(list).xorBy(list, list, list, list, list, "a"); // $ExpectType LoDashExplicitWrapper _.chain(list).xorBy(list, {a: 1}); // $ExpectType LoDashExplicitWrapper _.chain(list).xorBy(list, list, list, list, list, {a: 1}); // $ExpectType LoDashExplicitWrapper - fp.xorBy(iteratee, list, list); // $ExpectType AbcObject[] - fp.xorBy(iteratee)(list)(list); // $ExpectType AbcObject[] + fp.xorBy(valueIterator, list, list); // $ExpectType AbcObject[] + fp.xorBy(valueIterator)(list)(list); // $ExpectType AbcObject[] fp.xorBy("a", list, list); // $ExpectType AbcObject[] fp.xorBy({ a: 1 }, list, list); // $ExpectType AbcObject[] } // _.zip { - const list: _.List | null | undefined = anything; - _.zip(list); // $ExpectType (AbcObject | undefined)[][] _.zip(list, list); // $ExpectType (AbcObject | undefined)[][] _.zip(list, list, list, list, list, list); // $ExpectType (AbcObject | undefined)[][] @@ -1691,9 +1567,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; const abcObject: AbcObject | null | undefined = anything; _.at(list, 0, "1", [2], ["3"], [4, "5"]); // $ExpectType AbcObject[] @@ -1719,13 +1592,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - - const stringIterator = (value: string) => 1; - const valueIterator = (value: AbcObject) => 1; - _.countBy(""); // $ExpectType Dictionary _.countBy("", stringIterator); // $ExpectType Dictionary @@ -1793,15 +1659,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - - const listIterator = (value: AbcObject, index: number, collection: _.List) => true; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => true; - const valueIterator = (value: AbcObject) => true; - _.every(list); // $ExpectType boolean _.every(list, listIterator); // $ExpectType boolean _.every(list, "a"); // $ExpectType boolean @@ -1874,13 +1731,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const stringIterator = (char: string, index: number, string: string) => true; - const listIterator = (value: AbcObject, index: number, collection: _.List) => true; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - const valueIterator = (value: AbcObject) => true; _.filter("", stringIterator); // $ExpectType string[] _.filter(list, listIterator); // $ExpectType AbcObject[] @@ -1942,13 +1793,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - - const listIterator = (value: AbcObject, index: number, collection: _.List) => true; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - const valueIterator = (value: AbcObject) => true; - _.find(list); // $ExpectType AbcObject | undefined _.find(list, listIterator); // $ExpectType AbcObject | undefined _.find(list, listIterator, 1); // $ExpectType AbcObject | undefined @@ -2138,7 +1982,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; @@ -2206,22 +2050,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const objList: _.List<{a: number}|Array<{a: number}>> | null | undefined = anything; - const numDictionary: _.Dictionary | null | undefined = anything; - const objDictionary: _.Dictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - const numNumericDictionary: _.NumericDictionary | null | undefined = anything; - const objNumericDictionary: _.NumericDictionary<{a: number}|Array<{a: number}>> | null | undefined = anything; - - const stringIterator = (value: string, index: number, collection: _.List): _.ListOfRecursiveArraysOrValues | string => ""; - const listIterator = (value: number | number[], index: number, collection: _.List): _.ListOfRecursiveArraysOrValues | number => 1; - const dictionaryIterator = (value: number | number[], key: string, collection: _.Dictionary): _.ListOfRecursiveArraysOrValues | number => 1; - const numericDictionaryIterator = (value: number | number[], key: string, collection: _.NumericDictionary): _.ListOfRecursiveArraysOrValues | number => 1; - const valueIterator = (value: number | number[]): _.ListOfRecursiveArraysOrValues | number => 1; _.flatMapDepth("abc"); // $ExpectType string[] _.flatMapDepth("abc", stringIterator); // $ExpectType string[] @@ -2289,7 +2117,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const nilDictionary: _.Dictionary | null | undefined = anything; const nilNumericDictionary: _.NumericDictionary | null | undefined = anything; - const abcObject: AbcObject = anything; const nilAbcObject: AbcObject | null | undefined = anything; // $ExpectType string @@ -2516,16 +2343,14 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper }); - const stringIterator2 = (char: string) => 1; - const listIterator2 = (value: AbcObject) => 1; - fp.forEach(stringIterator2, ""); // $ExpectType string - fp.forEach(listIterator2, array); // $ExpectType AbcObject[] - fp.forEach(listIterator2)(array); // $ExpectType AbcObject[] - fp.forEach(listIterator2, list); // $ExpectType ArrayLike - fp.forEach(listIterator2, dictionary); // $ExpectType Dictionary - fp.forEach(listIterator2, nilArray); // $ExpectType AbcObject[] | null | undefined - fp.forEach(listIterator2, nilList); // $ExpectType ArrayLike | null | undefined - fp.forEach(listIterator2, nilDictionary); // $ExpectType Dictionary | null | undefined + fp.forEach(stringIterator, ""); // $ExpectType string + fp.forEach(valueIterator, array); // $ExpectType AbcObject[] + fp.forEach(valueIterator)(array); // $ExpectType AbcObject[] + fp.forEach(valueIterator, list); // $ExpectType ArrayLike + fp.forEach(valueIterator, dictionary); // $ExpectType Dictionary + fp.forEach(valueIterator, nilArray); // $ExpectType AbcObject[] | null | undefined + fp.forEach(valueIterator, nilList); // $ExpectType ArrayLike | null | undefined + fp.forEach(valueIterator, nilDictionary); // $ExpectType Dictionary | null | undefined // $ExpectType AbcObject[] _.forEachRight(array, (value, index, collection) => { @@ -2563,8 +2388,8 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper }); - fp.forEachRight(listIterator2, array); // $ExpectType AbcObject[] - fp.forEachRight(listIterator2)(array); // $ExpectType AbcObject[] + fp.forEachRight(valueIterator, array); // $ExpectType AbcObject[] + fp.forEachRight(valueIterator)(array); // $ExpectType AbcObject[] // $ExpectType AbcObject[] _.each(array, (value, index, collection) => { @@ -2602,8 +2427,8 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper }); - fp.each(listIterator2, array); // $ExpectType AbcObject[] - fp.each(listIterator2)(array); // $ExpectType AbcObject[] + fp.each(valueIterator, array); // $ExpectType AbcObject[] + fp.each(valueIterator)(array); // $ExpectType AbcObject[] // $ExpectType AbcObject[] _.eachRight(array, (value, index, collection) => { @@ -2641,18 +2466,12 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper }); - fp.eachRight(listIterator2, array); // $ExpectType AbcObject[] - fp.eachRight(listIterator2)(array); // $ExpectType AbcObject[] + fp.eachRight(valueIterator, array); // $ExpectType AbcObject[] + fp.eachRight(valueIterator)(array); // $ExpectType AbcObject[] } // _.groupBy { - const list: _.List | null | undefined = [] as any; - const dictionary: _.Dictionary | null | undefined = anything; - - const stringIterator = (char: string) => 0; - const valueIterator = (value: AbcObject) => 0; - _.groupBy(""); // $ExpectType Dictionary _.groupBy("", stringIterator); // $ExpectType Dictionary _.groupBy(list); // $ExpectType Dictionary @@ -2699,42 +2518,33 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const target: AbcObject = { a: 42, b: "", c: true }; + _.includes(list, abcObject); // $ExpectType boolean + _.includes(list, abcObject, 42); // $ExpectType boolean + _.includes(dictionary, abcObject); // $ExpectType boolean + _.includes(dictionary, abcObject, 42); // $ExpectType boolean - _.includes(list, target); // $ExpectType boolean - _.includes(list, target, 42); // $ExpectType boolean - _.includes(dictionary, target); // $ExpectType boolean - _.includes(dictionary, target, 42); // $ExpectType boolean + _(list).includes(abcObject); // $ExpectType boolean + _(list).includes(abcObject, 42); // $ExpectType boolean + _(dictionary).includes(abcObject); // $ExpectType boolean + _(dictionary).includes(abcObject, 42); // $ExpectType boolean - _(list).includes(target); // $ExpectType boolean - _(list).includes(target, 42); // $ExpectType boolean - _(dictionary).includes(target); // $ExpectType boolean - _(dictionary).includes(target, 42); // $ExpectType boolean + _.chain(list).includes(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(list).includes(abcObject, 42); // $ExpectType LoDashExplicitWrapper + _.chain(dictionary).includes(abcObject); // $ExpectType LoDashExplicitWrapper + _.chain(dictionary).includes(abcObject, 42); // $ExpectType LoDashExplicitWrapper - _.chain(list).includes(target); // $ExpectType LoDashExplicitWrapper - _.chain(list).includes(target, 42); // $ExpectType LoDashExplicitWrapper - _.chain(dictionary).includes(target); // $ExpectType LoDashExplicitWrapper - _.chain(dictionary).includes(target, 42); // $ExpectType LoDashExplicitWrapper + fp.includes(abcObject, list); // $ExpectType boolean + fp.includes(abcObject)(list); // $ExpectType boolean + fp.includes(abcObject, dictionary); // $ExpectType boolean - fp.includes(target, list); // $ExpectType boolean - fp.includes(target)(list); // $ExpectType boolean - fp.includes(target, dictionary); // $ExpectType boolean - - fp.includesFrom(target, 42, list); // $ExpectType boolean - fp.includesFrom(target)(42)(list); // $ExpectType boolean - fp.includesFrom(target, 42, dictionary); // $ExpectType boolean + fp.includesFrom(abcObject, 42, list); // $ExpectType boolean + fp.includesFrom(abcObject)(42)(list); // $ExpectType boolean + fp.includesFrom(abcObject, 42, dictionary); // $ExpectType boolean } // _.keyBy { - const list: _.List | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - - const stringIterator = (value: string) => "a"; - const valueIterator = (value: AbcObject) => 1; + const valueIterator = (value: AbcObject) => ""; _.keyBy("abcd"); // $ExpectType Dictionary _.keyBy("abcd", stringIterator); // $ExpectType Dictionary @@ -2878,11 +2688,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - const abcObject: AbcObject = anything; - _.map(list); // $ExpectType AbcObject[] // $ExpectType number[] _.map(list, (value, index, collection) => { @@ -2995,8 +2800,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - // $ExpectType [any[], any[]] _.partition(anything, (value) => { value; // $ExpectType any @@ -3110,13 +2913,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const stringIterator = (char: string, index: number, string: string) => true; - const listIterator = (value: AbcObject, index: number, collection: _.List) => true; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - const valueIterator = (value: AbcObject) => true; _.reject("", stringIterator); // $ExpectType string[] _.reject(list, listIterator); // $ExpectType AbcObject[] @@ -3207,9 +3004,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - _.shuffle("abc"); // $ExpectType string[] _.shuffle(list); // $ExpectType AbcObject[] _.shuffle(dictionary); // $ExpectType AbcObject[] @@ -3226,9 +3020,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - _.size(list); // $ExpectType number _.size(dictionary); // $ExpectType number _.size(""); // $ExpectType number @@ -3245,15 +3036,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - - const listIterator = (value: AbcObject, index: number, collection: _.List) => true; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => true; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => true; - const valueIterator = (value: AbcObject) => true; - _.some(list); // $ExpectType boolean _.some(list, listIterator); // $ExpectType boolean _.some(list, "a"); // $ExpectType boolean @@ -3326,13 +3108,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - - const listIterator = (value: AbcObject, index: number, collection: _.List) => 0; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; - const valueIterator = (value: AbcObject) => 0; - _.sortBy(list); // $ExpectType AbcObject[] _.sortBy(list, listIterator); // $ExpectType AbcObject[] _.sortBy(list, listIterator, listIterator); // $ExpectType AbcObject[] @@ -3380,10 +3155,6 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - const dictionary: _.Dictionary | null | undefined = anything; - _.orderBy("acbd", (value) => 1); // $ExpectType string[] _.orderBy("acbd", (value) => 1, true); // $ExpectType string[] _.orderBy("acbd", [(value) => 1, (value) => 2], [true, false]); // $ExpectType string[] @@ -4882,8 +4653,6 @@ fp.now(); // $ExpectType number { const list: ArrayLike = anything; - const valueIterator = (value: AbcObject) => 0; - _.maxBy(list, valueIterator); // $ExpectType AbcObject | undefined _.maxBy(list, "a"); // $ExpectType AbcObject | undefined _.maxBy(list, { a: 42 }); // $ExpectType AbcObject | undefined @@ -4976,7 +4745,6 @@ fp.now(); // $ExpectType number // _.sumBy { - const list: ArrayLike | null | undefined = anything; const listIterator = (value: AbcObject) => 0; _.sumBy(list, listIterator); // $ExpectType number @@ -5235,7 +5003,6 @@ fp.now(); // $ExpectType number { const dictionary: _.Dictionary = anything; const numericDictionary: _.NumericDictionary = anything; - const abcObject: AbcObject = anything; _.entries(dictionary); // $ExpectType [string, number][] _.entries(numericDictionary); // $ExpectType [string, number][] @@ -5362,17 +5129,15 @@ fp.now(); // $ExpectType number // _.functions // _.functionsIn { - const object: AbcObject = anything; + _.functions(abcObject); // $ExpectType string[] + _(abcObject).functions(); // $ExpectType LoDashImplicitWrapper + _.chain(abcObject).functions(); // $ExpectType LoDashExplicitWrapper + fp.functions(abcObject); // $ExpectType string[] - _.functions(object); // $ExpectType string[] - _(object).functions(); // $ExpectType LoDashImplicitWrapper - _.chain(object).functions(); // $ExpectType LoDashExplicitWrapper - fp.functions(object); // $ExpectType string[] - - _.functionsIn(object); // $ExpectType string[] - _(object).functionsIn(); // $ExpectType LoDashImplicitWrapper - _.chain(object).functionsIn(); // $ExpectType LoDashExplicitWrapper - fp.functionsIn(object); // $ExpectType string[] + _.functionsIn(abcObject); // $ExpectType string[] + _(abcObject).functionsIn(); // $ExpectType LoDashImplicitWrapper + _.chain(abcObject).functionsIn(); // $ExpectType LoDashExplicitWrapper + fp.functionsIn(abcObject); // $ExpectType string[] } // _.get @@ -5419,33 +5184,31 @@ fp.now(); // $ExpectType number // _.has // _.hasIn { - const object: AbcObject = anything; + _.has(abcObject, ""); // $ExpectType boolean + _.has(abcObject, 42); // $ExpectType boolean + _.has(abcObject, ["", 42]); // $ExpectType boolean + _(abcObject).has(""); // $ExpectType boolean + _(abcObject).has(42); // $ExpectType boolean + _(abcObject).has(["", 42]); // $ExpectType boolean + _.chain(abcObject).has(""); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).has(42); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).has(["", 42]); // $ExpectType LoDashExplicitWrapper + fp.has("a", abcObject); // $ExpectType boolean + fp.has("a")(abcObject); // $ExpectType boolean + fp.has(["a", 42])(abcObject); // $ExpectType boolean - _.has(object, ""); // $ExpectType boolean - _.has(object, 42); // $ExpectType boolean - _.has(object, ["", 42]); // $ExpectType boolean - _(object).has(""); // $ExpectType boolean - _(object).has(42); // $ExpectType boolean - _(object).has(["", 42]); // $ExpectType boolean - _.chain(object).has(""); // $ExpectType LoDashExplicitWrapper - _.chain(object).has(42); // $ExpectType LoDashExplicitWrapper - _.chain(object).has(["", 42]); // $ExpectType LoDashExplicitWrapper - fp.has("a", object); // $ExpectType boolean - fp.has("a")(object); // $ExpectType boolean - fp.has(["a", 42])(object); // $ExpectType boolean - - _.hasIn(object, ""); // $ExpectType boolean - _.hasIn(object, 42); // $ExpectType boolean - _.hasIn(object, ["", 42]); // $ExpectType boolean - _(object).hasIn(""); // $ExpectType boolean - _(object).hasIn(42); // $ExpectType boolean - _(object).hasIn(["", 42]); // $ExpectType boolean - _.chain(object).hasIn(""); // $ExpectType LoDashExplicitWrapper - _.chain(object).hasIn(42); // $ExpectType LoDashExplicitWrapper - _.chain(object).hasIn(["", 42]); // $ExpectType LoDashExplicitWrapper - fp.hasIn("a", object); // $ExpectType boolean - fp.hasIn("a")(object); // $ExpectType boolean - fp.hasIn(["a", 42])(object); // $ExpectType boolean + _.hasIn(abcObject, ""); // $ExpectType boolean + _.hasIn(abcObject, 42); // $ExpectType boolean + _.hasIn(abcObject, ["", 42]); // $ExpectType boolean + _(abcObject).hasIn(""); // $ExpectType boolean + _(abcObject).hasIn(42); // $ExpectType boolean + _(abcObject).hasIn(["", 42]); // $ExpectType boolean + _.chain(abcObject).hasIn(""); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).hasIn(42); // $ExpectType LoDashExplicitWrapper + _.chain(abcObject).hasIn(["", 42]); // $ExpectType LoDashExplicitWrapper + fp.hasIn("a", abcObject); // $ExpectType boolean + fp.hasIn("a")(abcObject); // $ExpectType boolean + fp.hasIn(["a", 42])(abcObject); // $ExpectType boolean } // _.invert @@ -5462,7 +5225,6 @@ fp.now(); // $ExpectType number const dictionary: _.Dictionary<{ a: number }> = {}; const numericDictionary: _.NumericDictionary<{ a: number }> = {}; - const stringIterator = (value: string) => 1; const valueIterator = (value: {a: number }) => 1; _.invertBy("foo"); // $ExpectType Dictionary @@ -5523,14 +5285,6 @@ fp.now(); // $ExpectType number // _.mapKeys { - const list: _.List| null | undefined = [] as any; - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - const abcObject: AbcObject = anything; - - const listIterator = (value: AbcObject, index: number, collection: _.List) => ""; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => ""; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => ""; const abcObjectIterator = (value: AbcObject[keyof AbcObject], key: string, collection: AbcObject) => ""; _.mapKeys(list); // $ExpectType Dictionary @@ -5605,9 +5359,6 @@ fp.now(); // $ExpectType number // _.mapValues { - const dictionary: _.Dictionary | null | undefined = anything; - const numericDictionary: _.NumericDictionary | null | undefined = anything; - const abcObject: AbcObject = anything; const abcObjectOrNull: AbcObject | null = anything; const key: string = anything; @@ -5774,10 +5525,9 @@ fp.now(); // $ExpectType number _.chain(abcObject).mapValues(); // $ExpectType LoDashExplicitWrapper _.chain(abcObjectOrNull).mapValues(); // $ExpectType LoDashExplicitWrapper> - const valueIterator = (value: AbcObject) => ""; - fp.mapValues(valueIterator)(dictionary); // $ExpectType Dictionary + fp.mapValues(valueIterator)(dictionary); // $ExpectType Dictionary fp.mapValues("a", dictionary); // $ExpectType Dictionary - fp.mapValues(valueIterator)(numericDictionary); // $ExpectType Dictionary + fp.mapValues(valueIterator)(numericDictionary); // $ExpectType Dictionary fp.mapValues({ a: 42 })(numericDictionary); // $ExpectType Dictionary fp.mapValues(value => "", abcObjectOrNull); // $ExpectType { a: string; b: string; c: string; } } @@ -5953,7 +5703,6 @@ fp.now(); // $ExpectType number { const dictionary: _.Dictionary = {}; const numericDictionary: _.NumericDictionary = {}; - const abcObject: AbcObject = anything; _.toPairs(dictionary); // $ExpectType [string, number][] _.toPairs(numericDictionary); // $ExpectType [string, number][] @@ -6108,8 +5857,6 @@ fp.now(); // $ExpectType number { const dict: _.Dictionary = {}; const numDict: _.NumericDictionary = {}; - const list: _.List | null | undefined = anything; - const object: AbcObject = anything; _.values(123); // $ExpectType any[] _.values(true); // $ExpectType any[] @@ -6119,7 +5866,7 @@ fp.now(); // $ExpectType number _.values(dict); // $ExpectType AbcObject[] _.values(numDict); // $ExpectType AbcObject[] _.values(list); // $ExpectType AbcObject[] - _.values(object); // $ExpectType (string | number | boolean)[] + _.values(abcObject); // $ExpectType (string | number | boolean)[] _(true).values(); // $ExpectType LoDashImplicitWrapper _("hi").values(); // $ExpectType LoDashImplicitWrapper @@ -6135,13 +5882,13 @@ fp.now(); // $ExpectType number fp.values(dict); // $ExpectType AbcObject[] fp.values(numDict); // $ExpectType AbcObject[] fp.values(list); // $ExpectType AbcObject[] - fp.values(object); // $ExpectType (string | number | boolean)[] + fp.values(abcObject); // $ExpectType (string | number | boolean)[] _.valuesIn([true, false]); // $ExpectType boolean[] _.valuesIn(dict); // $ExpectType AbcObject[] _.valuesIn(numDict); // $ExpectType AbcObject[] _.valuesIn(list); // $ExpectType AbcObject[] - _.valuesIn(object); // $ExpectType (string | number | boolean)[] + _.valuesIn(abcObject); // $ExpectType (string | number | boolean)[] _(dict).valuesIn(); // $ExpectType LoDashImplicitWrapper _.chain(dict).valuesIn(); // $ExpectType LoDashExplicitWrapper @@ -6149,7 +5896,7 @@ fp.now(); // $ExpectType number fp.valuesIn(dict); // $ExpectType AbcObject[] fp.valuesIn(numDict); // $ExpectType AbcObject[] fp.valuesIn(list); // $ExpectType AbcObject[] - fp.valuesIn(object); // $ExpectType (string | number | boolean)[] + fp.valuesIn(abcObject); // $ExpectType (string | number | boolean)[] } /******* @@ -6163,16 +5910,7 @@ fp.now(); // $ExpectType number _(true); // $ExpectType LoDashImplicitWrapper _([""]); // $ExpectType LoDashImplicitWrapper _({ a: "" }); // $ExpectType LoDashImplicitWrapper<{ a: string; }> - - { - const a: AbcObject[] = []; - _(a); // $ExpectType LoDashImplicitWrapper - } - - { - const a: AbcObject[] | null | undefined = anything; - _(a); // $ExpectType LoDashImplicitWrapper - } + _(array); // $ExpectType LoDashImplicitWrapper } // _.chain @@ -6319,7 +6057,6 @@ fp.now(); // $ExpectType number _.chain(numberROA).concat(numberROA); // $ExpectType LoDashExplicitWrapper _.chain(numberROA).concat(numberROA, numberROA); // $ExpectType LoDashExplicitWrapper - const abcObject: AbcObject = { a: 1, b: 'foo', c: true }; const objectROA: AbcObject[] = [{ a: 1, b: 'foo', c: true }]; // TODO: Should be ReadonlyArray, but see comment on type Many _.concat(abcObject, abcObject); // $ExpectType AbcObject[] @@ -6889,28 +6626,25 @@ fp.now(); // $ExpectType number // _.matches { - const source: AbcObject = { a: 1, b: "", c: true }; + _.matches(abcObject); // $ExpectType (value: any) => boolean + _.matches(abcObject); // $ExpectType (value: AbcObject) => boolean + _(abcObject).matches(); // $ExpectType LoDashImplicitWrapper<(value: AbcObject) => boolean> + _.chain(abcObject).matches(); // $ExpectType LoDashExplicitWrapper<(value: AbcObject) => boolean> - _.matches(source); // $ExpectType (value: any) => boolean - _.matches(source); // $ExpectType (value: AbcObject) => boolean - _(source).matches(); // $ExpectType LoDashImplicitWrapper<(value: AbcObject) => boolean> - _.chain(source).matches(); // $ExpectType LoDashExplicitWrapper<(value: AbcObject) => boolean> - - fp.matches(source, {}); // $ExpectType boolean - fp.matches(source)({}); // $ExpectType boolean + fp.matches(abcObject, {}); // $ExpectType boolean + fp.matches(abcObject)({}); // $ExpectType boolean } // _.matchesProperty { const path: string | string[] = anything; - const source: AbcObject = { a: 1, b: "", c: true }; - _.matchesProperty(path, source); // $ExpectType (value: any) => boolean - _.matchesProperty(path, source); // $ExpectType (value: AbcObject) => boolean - _(path).matchesProperty(source); // $ExpectType LoDashImplicitWrapper<(value: any) => boolean> - _(path).matchesProperty(source); - _.chain(path).matchesProperty(source); // $ExpectType LoDashExplicitWrapper<(value: any) => boolean> - fp.matchesProperty(path, source); // $ExpectType (value: any) => boolean + _.matchesProperty(path, abcObject); // $ExpectType (value: any) => boolean + _.matchesProperty(path, abcObject); // $ExpectType (value: AbcObject) => boolean + _(path).matchesProperty(abcObject); // $ExpectType LoDashImplicitWrapper<(value: any) => boolean> + _(path).matchesProperty(abcObject); + _.chain(path).matchesProperty(abcObject); // $ExpectType LoDashExplicitWrapper<(value: any) => boolean> + fp.matchesProperty(path, abcObject); // $ExpectType (value: any) => boolean } // _.method @@ -6937,15 +6671,13 @@ fp.now(); // $ExpectType number // _.methodOf { - const object: AbcObject = anything; - - _.methodOf(object) as (path: _.Many<_.PropertyName>) => any; - _.methodOf(object, anything, anything, anything) as (path: _.Many<_.PropertyName>) => any; - _(object).methodOf() as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; - _(object).methodOf(anything, anything, anything) as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; - _.chain(object).methodOf() as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; - _.chain(object).methodOf(anything, anything, anything) as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; - fp.methodOf(object) as (path: _.Many<_.PropertyName>) => any; + _.methodOf(abcObject) as (path: _.Many<_.PropertyName>) => any; + _.methodOf(abcObject, anything, anything, anything) as (path: _.Many<_.PropertyName>) => any; + _(abcObject).methodOf() as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _(abcObject).methodOf(anything, anything, anything) as _.LoDashImplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _.chain(abcObject).methodOf() as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + _.chain(abcObject).methodOf(anything, anything, anything) as _.LoDashExplicitWrapper<(path: _.Many<_.PropertyName>) => any>; + fp.methodOf(abcObject) as (path: _.Many<_.PropertyName>) => any; } // _.mixin diff --git a/types/lodash/tsconfig.json b/types/lodash/tsconfig.json index 5a160103d4..60a2e8323c 100644 --- a/types/lodash/tsconfig.json +++ b/types/lodash/tsconfig.json @@ -20,7 +20,305 @@ "files": [ "index.d.ts", "lodash-tests.ts", + "add.d.ts", + "after.d.ts", + "ary.d.ts", + "assign.d.ts", + "assignIn.d.ts", + "assignInWith.d.ts", + "assignWith.d.ts", + "at.d.ts", + "attempt.d.ts", + "before.d.ts", + "bind.d.ts", + "bindAll.d.ts", + "bindKey.d.ts", + "camelCase.d.ts", + "capitalize.d.ts", + "castArray.d.ts", + "ceil.d.ts", + "chain.d.ts", + "chunk.d.ts", + "clamp.d.ts", + "clone.d.ts", + "cloneDeep.d.ts", + "cloneDeepWith.d.ts", + "cloneWith.d.ts", + "compact.d.ts", + "concat.d.ts", + "cond.d.ts", + "conformsTo.d.ts", + "constant.d.ts", + "countBy.d.ts", + "create.d.ts", + "curry.d.ts", + "curryRight.d.ts", + "debounce.d.ts", + "deburr.d.ts", + "defaults.d.ts", + "defaultsDeep.d.ts", + "defaultTo.d.ts", + "defer.d.ts", + "delay.d.ts", + "difference.d.ts", + "differenceBy.d.ts", + "differenceWith.d.ts", + "divide.d.ts", + "drop.d.ts", + "dropRight.d.ts", + "dropRightWhile.d.ts", + "dropWhile.d.ts", + "each.d.ts", + "eachRight.d.ts", + "endsWith.d.ts", + "entries.d.ts", + "entriesIn.d.ts", + "eq.d.ts", + "escape.d.ts", + "escapeRegExp.d.ts", + "every.d.ts", + "extend.d.ts", + "extendWith.d.ts", + "fill.d.ts", + "filter.d.ts", + "find.d.ts", + "findIndex.d.ts", + "findKey.d.ts", + "findLast.d.ts", + "findLastIndex.d.ts", + "findLastKey.d.ts", + "first.d.ts", + "flatMap.d.ts", + "flatMapDeep.d.ts", + "flatMapDepth.d.ts", + "flatten.d.ts", + "flattenDeep.d.ts", + "flattenDepth.d.ts", + "flip.d.ts", + "floor.d.ts", + "flow.d.ts", + "flowRight.d.ts", + "forEach.d.ts", + "forEachRight.d.ts", + "forIn.d.ts", + "forInRight.d.ts", + "forOwn.d.ts", + "forOwnRight.d.ts", "fp.d.ts", + "fromPairs.d.ts", + "functions.d.ts", + "functionsIn.d.ts", + "get.d.ts", + "groupBy.d.ts", + "gt.d.ts", + "gte.d.ts", + "has.d.ts", + "hasIn.d.ts", + "head.d.ts", + "identity.d.ts", + "includes.d.ts", + "indexOf.d.ts", + "initial.d.ts", + "inRange.d.ts", + "intersection.d.ts", + "intersectionBy.d.ts", + "intersectionWith.d.ts", + "invert.d.ts", + "invertBy.d.ts", + "invoke.d.ts", + "invokeMap.d.ts", + "isArguments.d.ts", + "isArray.d.ts", + "isArrayBuffer.d.ts", + "isArrayLike.d.ts", + "isArrayLikeObject.d.ts", + "isBoolean.d.ts", + "isBuffer.d.ts", + "isDate.d.ts", + "isElement.d.ts", + "isEmpty.d.ts", + "isEqual.d.ts", + "isEqualWith.d.ts", + "isError.d.ts", + "isFinite.d.ts", + "isFunction.d.ts", + "isInteger.d.ts", + "isLength.d.ts", + "isMap.d.ts", + "isMatch.d.ts", + "isMatchWith.d.ts", + "isNaN.d.ts", + "isNative.d.ts", + "isNil.d.ts", + "isNull.d.ts", + "isNumber.d.ts", + "isObject.d.ts", + "isObjectLike.d.ts", + "isPlainObject.d.ts", + "isRegExp.d.ts", + "isSafeInteger.d.ts", + "isSet.d.ts", + "isString.d.ts", + "isSymbol.d.ts", + "isTypedArray.d.ts", + "isUndefined.d.ts", + "isWeakMap.d.ts", + "isWeakSet.d.ts", + "iteratee.d.ts", + "join.d.ts", + "kebabCase.d.ts", + "keyBy.d.ts", + "keys.d.ts", + "keysIn.d.ts", + "last.d.ts", + "lastIndexOf.d.ts", + "lowerCase.d.ts", + "lowerFirst.d.ts", + "lt.d.ts", + "lte.d.ts", + "map.d.ts", + "mapKeys.d.ts", + "mapValues.d.ts", + "matches.d.ts", + "matchesProperty.d.ts", + "max.d.ts", + "maxBy.d.ts", + "mean.d.ts", + "meanBy.d.ts", + "memoize.d.ts", + "merge.d.ts", + "mergeWith.d.ts", + "method.d.ts", + "methodOf.d.ts", + "min.d.ts", + "minBy.d.ts", + "mixin.d.ts", + "negate.d.ts", + "noConflict.d.ts", + "noop.d.ts", + "now.d.ts", + "nth.d.ts", + "nthArg.d.ts", + "omit.d.ts", + "omitBy.d.ts", + "once.d.ts", + "orderBy.d.ts", + "over.d.ts", + "overArgs.d.ts", + "overEvery.d.ts", + "overSome.d.ts", + "pad.d.ts", + "padEnd.d.ts", + "padStart.d.ts", + "parseInt.d.ts", + "partial.d.ts", + "partialRight.d.ts", + "partition.d.ts", + "pick.d.ts", + "pickBy.d.ts", + "property.d.ts", + "propertyOf.d.ts", + "pull.d.ts", + "pullAll.d.ts", + "pullAllBy.d.ts", + "pullAllWith.d.ts", + "pullAt.d.ts", + "random.d.ts", + "range.d.ts", + "rangeRight.d.ts", + "rearg.d.ts", + "reduce.d.ts", + "reduceRight.d.ts", + "reject.d.ts", + "remove.d.ts", + "repeat.d.ts", + "replace.d.ts", + "rest.d.ts", + "result.d.ts", + "reverse.d.ts", + "round.d.ts", + "runInContext.d.ts", + "sample.d.ts", + "sampleSize.d.ts", + "set.d.ts", + "setWith.d.ts", + "shuffle.d.ts", + "size.d.ts", + "slice.d.ts", + "snakeCase.d.ts", + "some.d.ts", + "sortBy.d.ts", + "sortedIndex.d.ts", + "sortedIndexBy.d.ts", + "sortedIndexOf.d.ts", + "sortedLastIndex.d.ts", + "sortedLastIndexBy.d.ts", + "sortedLastIndexOf.d.ts", + "sortedUniq.d.ts", + "sortedUniqBy.d.ts", + "split.d.ts", + "spread.d.ts", + "startCase.d.ts", + "startsWith.d.ts", + "subtract.d.ts", + "sum.d.ts", + "sumBy.d.ts", + "tail.d.ts", + "take.d.ts", + "takeRight.d.ts", + "takeRightWhile.d.ts", + "takeWhile.d.ts", + "tap.d.ts", + "template.d.ts", + "throttle.d.ts", + "thru.d.ts", + "times.d.ts", + "toArray.d.ts", + "toFinite.d.ts", + "toInteger.d.ts", + "toLength.d.ts", + "toLower.d.ts", + "toNumber.d.ts", + "toPairs.d.ts", + "toPairsIn.d.ts", + "toPath.d.ts", + "toPlainObject.d.ts", + "toSafeInteger.d.ts", + "toString.d.ts", + "toUpper.d.ts", + "transform.d.ts", + "trim.d.ts", + "trimEnd.d.ts", + "trimStart.d.ts", + "truncate.d.ts", + "unary.d.ts", + "unescape.d.ts", + "union.d.ts", + "unionBy.d.ts", + "unionWith.d.ts", + "uniq.d.ts", + "uniqBy.d.ts", + "uniqueId.d.ts", + "uniqWith.d.ts", + "unset.d.ts", + "unzip.d.ts", + "unzipWith.d.ts", + "update.d.ts", + "updateWith.d.ts", + "upperCase.d.ts", + "upperFirst.d.ts", + "values.d.ts", + "valuesIn.d.ts", + "without.d.ts", + "words.d.ts", + "wrap.d.ts", + "xor.d.ts", + "xorBy.d.ts", + "xorWith.d.ts", + "zip.d.ts", + "zipObject.d.ts", + "zipObjectDeep.d.ts", + "zipWith.d.ts", "common/array.d.ts", "common/collection.d.ts", "common/common.d.ts", @@ -32,6 +330,392 @@ "common/object.d.ts", "common/seq.d.ts", "common/string.d.ts", - "common/util.d.ts" + "common/util.d.ts", + "fp/convert.d.ts", + "fp/add.d.ts", + "fp/after.d.ts", + "fp/all.d.ts", + "fp/allPass.d.ts", + "fp/always.d.ts", + "fp/any.d.ts", + "fp/anyPass.d.ts", + "fp/apply.d.ts", + "fp/ary.d.ts", + "fp/assign.d.ts", + "fp/assignAll.d.ts", + "fp/assignAllWith.d.ts", + "fp/assignIn.d.ts", + "fp/assignInAll.d.ts", + "fp/assignInAllWith.d.ts", + "fp/assignInWith.d.ts", + "fp/assignWith.d.ts", + "fp/assoc.d.ts", + "fp/assocPath.d.ts", + "fp/at.d.ts", + "fp/attempt.d.ts", + "fp/before.d.ts", + "fp/bind.d.ts", + "fp/bindAll.d.ts", + "fp/bindKey.d.ts", + "fp/camelCase.d.ts", + "fp/capitalize.d.ts", + "fp/castArray.d.ts", + "fp/ceil.d.ts", + "fp/chunk.d.ts", + "fp/clamp.d.ts", + "fp/clone.d.ts", + "fp/cloneDeep.d.ts", + "fp/cloneDeepWith.d.ts", + "fp/cloneWith.d.ts", + "fp/compact.d.ts", + "fp/complement.d.ts", + "fp/compose.d.ts", + "fp/concat.d.ts", + "fp/cond.d.ts", + "fp/conforms.d.ts", + "fp/conformsTo.d.ts", + "fp/constant.d.ts", + "fp/contains.d.ts", + "fp/countBy.d.ts", + "fp/create.d.ts", + "fp/curry.d.ts", + "fp/curryN.d.ts", + "fp/curryRight.d.ts", + "fp/curryRightN.d.ts", + "fp/debounce.d.ts", + "fp/deburr.d.ts", + "fp/defaults.d.ts", + "fp/defaultsAll.d.ts", + "fp/defaultsDeep.d.ts", + "fp/defaultsDeepAll.d.ts", + "fp/defaultTo.d.ts", + "fp/defer.d.ts", + "fp/delay.d.ts", + "fp/difference.d.ts", + "fp/differenceBy.d.ts", + "fp/differenceWith.d.ts", + "fp/dissoc.d.ts", + "fp/dissocPath.d.ts", + "fp/divide.d.ts", + "fp/drop.d.ts", + "fp/dropLast.d.ts", + "fp/dropLastWhile.d.ts", + "fp/dropRight.d.ts", + "fp/dropRightWhile.d.ts", + "fp/dropWhile.d.ts", + "fp/each.d.ts", + "fp/eachRight.d.ts", + "fp/endsWith.d.ts", + "fp/entries.d.ts", + "fp/entriesIn.d.ts", + "fp/eq.d.ts", + "fp/equals.d.ts", + "fp/escape.d.ts", + "fp/escapeRegExp.d.ts", + "fp/every.d.ts", + "fp/extend.d.ts", + "fp/extendAll.d.ts", + "fp/extendAllWith.d.ts", + "fp/extendWith.d.ts", + "fp/F.d.ts", + "fp/fill.d.ts", + "fp/filter.d.ts", + "fp/find.d.ts", + "fp/findFrom.d.ts", + "fp/findIndex.d.ts", + "fp/findIndexFrom.d.ts", + "fp/findKey.d.ts", + "fp/findLast.d.ts", + "fp/findLastFrom.d.ts", + "fp/findLastIndex.d.ts", + "fp/findLastIndexFrom.d.ts", + "fp/findLastKey.d.ts", + "fp/first.d.ts", + "fp/flatMap.d.ts", + "fp/flatMapDeep.d.ts", + "fp/flatMapDepth.d.ts", + "fp/flatten.d.ts", + "fp/flattenDeep.d.ts", + "fp/flattenDepth.d.ts", + "fp/flip.d.ts", + "fp/floor.d.ts", + "fp/flow.d.ts", + "fp/flowRight.d.ts", + "fp/forEach.d.ts", + "fp/forEachRight.d.ts", + "fp/forIn.d.ts", + "fp/forInRight.d.ts", + "fp/forOwn.d.ts", + "fp/forOwnRight.d.ts", + "fp/fromPairs.d.ts", + "fp/functions.d.ts", + "fp/functionsIn.d.ts", + "fp/get.d.ts", + "fp/getOr.d.ts", + "fp/groupBy.d.ts", + "fp/gt.d.ts", + "fp/gte.d.ts", + "fp/has.d.ts", + "fp/hasIn.d.ts", + "fp/head.d.ts", + "fp/identical.d.ts", + "fp/identity.d.ts", + "fp/includes.d.ts", + "fp/includesFrom.d.ts", + "fp/indexBy.d.ts", + "fp/indexOf.d.ts", + "fp/indexOfFrom.d.ts", + "fp/init.d.ts", + "fp/initial.d.ts", + "fp/inRange.d.ts", + "fp/intersection.d.ts", + "fp/intersectionBy.d.ts", + "fp/intersectionWith.d.ts", + "fp/invert.d.ts", + "fp/invertBy.d.ts", + "fp/invertObj.d.ts", + "fp/invoke.d.ts", + "fp/invokeArgs.d.ts", + "fp/invokeArgsMap.d.ts", + "fp/invokeMap.d.ts", + "fp/isArguments.d.ts", + "fp/isArray.d.ts", + "fp/isArrayBuffer.d.ts", + "fp/isArrayLike.d.ts", + "fp/isArrayLikeObject.d.ts", + "fp/isBoolean.d.ts", + "fp/isBuffer.d.ts", + "fp/isDate.d.ts", + "fp/isElement.d.ts", + "fp/isEmpty.d.ts", + "fp/isEqual.d.ts", + "fp/isEqualWith.d.ts", + "fp/isError.d.ts", + "fp/isFinite.d.ts", + "fp/isFunction.d.ts", + "fp/isInteger.d.ts", + "fp/isLength.d.ts", + "fp/isMap.d.ts", + "fp/isMatch.d.ts", + "fp/isMatchWith.d.ts", + "fp/isNaN.d.ts", + "fp/isNative.d.ts", + "fp/isNil.d.ts", + "fp/isNull.d.ts", + "fp/isNumber.d.ts", + "fp/isObject.d.ts", + "fp/isObjectLike.d.ts", + "fp/isPlainObject.d.ts", + "fp/isRegExp.d.ts", + "fp/isSafeInteger.d.ts", + "fp/isSet.d.ts", + "fp/isString.d.ts", + "fp/isSymbol.d.ts", + "fp/isTypedArray.d.ts", + "fp/isUndefined.d.ts", + "fp/isWeakMap.d.ts", + "fp/isWeakSet.d.ts", + "fp/iteratee.d.ts", + "fp/join.d.ts", + "fp/juxt.d.ts", + "fp/kebabCase.d.ts", + "fp/keyBy.d.ts", + "fp/keys.d.ts", + "fp/keysIn.d.ts", + "fp/last.d.ts", + "fp/lastIndexOf.d.ts", + "fp/lastIndexOfFrom.d.ts", + "fp/lowerCase.d.ts", + "fp/lowerFirst.d.ts", + "fp/lt.d.ts", + "fp/lte.d.ts", + "fp/map.d.ts", + "fp/mapKeys.d.ts", + "fp/mapValues.d.ts", + "fp/matches.d.ts", + "fp/matchesProperty.d.ts", + "fp/max.d.ts", + "fp/maxBy.d.ts", + "fp/mean.d.ts", + "fp/meanBy.d.ts", + "fp/memoize.d.ts", + "fp/merge.d.ts", + "fp/mergeAll.d.ts", + "fp/mergeAllWith.d.ts", + "fp/mergeWith.d.ts", + "fp/method.d.ts", + "fp/methodOf.d.ts", + "fp/min.d.ts", + "fp/minBy.d.ts", + "fp/multiply.d.ts", + "fp/nAry.d.ts", + "fp/negate.d.ts", + "fp/noConflict.d.ts", + "fp/noop.d.ts", + "fp/now.d.ts", + "fp/nth.d.ts", + "fp/nthArg.d.ts", + "fp/omit.d.ts", + "fp/omitAll.d.ts", + "fp/omitBy.d.ts", + "fp/once.d.ts", + "fp/orderBy.d.ts", + "fp/over.d.ts", + "fp/overArgs.d.ts", + "fp/overEvery.d.ts", + "fp/overSome.d.ts", + "fp/pad.d.ts", + "fp/padChars.d.ts", + "fp/padCharsEnd.d.ts", + "fp/padCharsStart.d.ts", + "fp/padEnd.d.ts", + "fp/padStart.d.ts", + "fp/parseInt.d.ts", + "fp/partial.d.ts", + "fp/partialRight.d.ts", + "fp/partition.d.ts", + "fp/path.d.ts", + "fp/pathEq.d.ts", + "fp/pathOr.d.ts", + "fp/paths.d.ts", + "fp/pick.d.ts", + "fp/pickAll.d.ts", + "fp/pickBy.d.ts", + "fp/pipe.d.ts", + "fp/pluck.d.ts", + "fp/prop.d.ts", + "fp/propEq.d.ts", + "fp/property.d.ts", + "fp/propertyOf.d.ts", + "fp/propOr.d.ts", + "fp/props.d.ts", + "fp/pull.d.ts", + "fp/pullAll.d.ts", + "fp/pullAllBy.d.ts", + "fp/pullAllWith.d.ts", + "fp/pullAt.d.ts", + "fp/random.d.ts", + "fp/range.d.ts", + "fp/rangeRight.d.ts", + "fp/rangeStep.d.ts", + "fp/rangeStepRight.d.ts", + "fp/rearg.d.ts", + "fp/reduce.d.ts", + "fp/reduceRight.d.ts", + "fp/reject.d.ts", + "fp/remove.d.ts", + "fp/repeat.d.ts", + "fp/replace.d.ts", + "fp/rest.d.ts", + "fp/restFrom.d.ts", + "fp/result.d.ts", + "fp/reverse.d.ts", + "fp/round.d.ts", + "fp/runInContext.d.ts", + "fp/sample.d.ts", + "fp/sampleSize.d.ts", + "fp/set.d.ts", + "fp/setWith.d.ts", + "fp/shuffle.d.ts", + "fp/size.d.ts", + "fp/slice.d.ts", + "fp/snakeCase.d.ts", + "fp/some.d.ts", + "fp/sortBy.d.ts", + "fp/sortedIndex.d.ts", + "fp/sortedIndexBy.d.ts", + "fp/sortedIndexOf.d.ts", + "fp/sortedLastIndex.d.ts", + "fp/sortedLastIndexBy.d.ts", + "fp/sortedLastIndexOf.d.ts", + "fp/sortedUniq.d.ts", + "fp/sortedUniqBy.d.ts", + "fp/split.d.ts", + "fp/spread.d.ts", + "fp/spreadFrom.d.ts", + "fp/startCase.d.ts", + "fp/startsWith.d.ts", + "fp/stubArray.d.ts", + "fp/stubFalse.d.ts", + "fp/stubObject.d.ts", + "fp/stubString.d.ts", + "fp/stubTrue.d.ts", + "fp/subtract.d.ts", + "fp/sum.d.ts", + "fp/sumBy.d.ts", + "fp/symmetricDifference.d.ts", + "fp/symmetricDifferenceBy.d.ts", + "fp/symmetricDifferenceWith.d.ts", + "fp/T.d.ts", + "fp/tail.d.ts", + "fp/take.d.ts", + "fp/takeLast.d.ts", + "fp/takeLastWhile.d.ts", + "fp/takeRight.d.ts", + "fp/takeRightWhile.d.ts", + "fp/takeWhile.d.ts", + "fp/tap.d.ts", + "fp/template.d.ts", + "fp/throttle.d.ts", + "fp/thru.d.ts", + "fp/times.d.ts", + "fp/toArray.d.ts", + "fp/toFinite.d.ts", + "fp/toInteger.d.ts", + "fp/toLength.d.ts", + "fp/toLower.d.ts", + "fp/toNumber.d.ts", + "fp/toPairs.d.ts", + "fp/toPairsIn.d.ts", + "fp/toPath.d.ts", + "fp/toPlainObject.d.ts", + "fp/toSafeInteger.d.ts", + "fp/toString.d.ts", + "fp/toUpper.d.ts", + "fp/transform.d.ts", + "fp/trim.d.ts", + "fp/trimChars.d.ts", + "fp/trimCharsEnd.d.ts", + "fp/trimCharsStart.d.ts", + "fp/trimEnd.d.ts", + "fp/trimStart.d.ts", + "fp/truncate.d.ts", + "fp/unapply.d.ts", + "fp/unary.d.ts", + "fp/unescape.d.ts", + "fp/union.d.ts", + "fp/unionBy.d.ts", + "fp/unionWith.d.ts", + "fp/uniq.d.ts", + "fp/uniqBy.d.ts", + "fp/uniqueId.d.ts", + "fp/uniqWith.d.ts", + "fp/unnest.d.ts", + "fp/unset.d.ts", + "fp/unzip.d.ts", + "fp/unzipWith.d.ts", + "fp/update.d.ts", + "fp/updateWith.d.ts", + "fp/upperCase.d.ts", + "fp/upperFirst.d.ts", + "fp/useWith.d.ts", + "fp/values.d.ts", + "fp/valuesIn.d.ts", + "fp/where.d.ts", + "fp/whereEq.d.ts", + "fp/without.d.ts", + "fp/words.d.ts", + "fp/wrap.d.ts", + "fp/xor.d.ts", + "fp/xorBy.d.ts", + "fp/xorWith.d.ts", + "fp/zip.d.ts", + "fp/zipAll.d.ts", + "fp/zipObj.d.ts", + "fp/zipObject.d.ts", + "fp/zipObjectDeep.d.ts", + "fp/zipWith.d.ts", + "fp/__.d.ts", + "fp/placeholder.d.ts" ] } \ No newline at end of file