diff --git a/types/lodash/common/collection.d.ts b/types/lodash/common/collection.d.ts index d8ddc97197..024116adc8 100644 --- a/types/lodash/common/collection.d.ts +++ b/types/lodash/common/collection.d.ts @@ -215,7 +215,7 @@ declare module "../index" { * @return Returns the new filtered array. */ filter( - collection: string | null | undefined, + collection: string | string[] | null | undefined, predicate?: StringIterator ): string[]; @@ -257,7 +257,7 @@ declare module "../index" { * @see _.filter */ filter( - this: LoDashImplicitWrapper, + this: LoDashImplicitWrapper, predicate?: StringIterator ): LoDashImplicitWrapper; @@ -299,7 +299,7 @@ declare module "../index" { * @see _.filter */ filter( - this: LoDashExplicitWrapper, + this: LoDashExplicitWrapper, predicate?: StringIterator ): LoDashExplicitWrapper; diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 9b6cf52ccb..a31b8b459d 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -918,8 +918,8 @@ declare namespace _ { type LodashFill2x14 = (start: number) => lodash.List; interface LodashFilter { (predicate: (value: string) => boolean): LodashFilter1x1; - (predicate: lodash.__, collection: string | null | undefined): LodashFilter1x2; - (predicate: (value: string) => boolean, collection: string | null | undefined): string[]; + (predicate: lodash.__, collection: string | string[] | null | undefined): LodashFilter1x2; + (predicate: (value: string) => boolean, collection: string | string[] | null | undefined): string[]; (predicate: lodash.ValueIteratorTypeGuard): LodashFilter2x1; (predicate: lodash.__, collection: lodash.List | null | undefined): LodashFilter2x2; (predicate: lodash.ValueIteratorTypeGuard, collection: lodash.List | null | undefined): S[]; @@ -930,7 +930,7 @@ declare namespace _ { (predicate: lodash.ValueIteratorTypeGuard, collection: T | null | undefined): S[]; (predicate: lodash.ValueIterateeCustom, collection: T | null | undefined): Array; } - type LodashFilter1x1 = (collection: string | null | undefined) => string[]; + type LodashFilter1x1 = (collection: string | string[] | null | undefined) => string[]; type LodashFilter1x2 = (predicate: (value: string) => boolean) => string[]; type LodashFilter2x1 = (collection: lodash.List | null | undefined) => S[]; interface LodashFilter2x2 { diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index 9d2547dcf4..1aa4bc3eb2 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1766,6 +1766,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts index 7267aab0d9..c332a229c6 100644 --- a/types/lowdb/_lodash.d.ts +++ b/types/lowdb/_lodash.d.ts @@ -459,7 +459,7 @@ declare module "./index" { predicate?: _.ObjectIterateeCustom ): LoDashExplicitSyncWrapper; filter( - this: LoDashExplicitSyncWrapper, + this: LoDashExplicitSyncWrapper, predicate?: _.StringIterator ): LoDashExplicitSyncWrapper; filter( @@ -2055,7 +2055,7 @@ declare module "./index" { predicate?: _.ObjectIterateeCustom ): LoDashExplicitAsyncWrapper; filter( - this: LoDashExplicitAsyncWrapper, + this: LoDashExplicitAsyncWrapper, predicate?: _.StringIterator ): LoDashExplicitAsyncWrapper; filter(