Code review fixes.

This commit is contained in:
Max Bogue
2019-01-16 09:51:41 -06:00
parent 9c21b9040c
commit 032f829ddb
3 changed files with 5 additions and 5 deletions

View File

@@ -257,7 +257,7 @@ declare module "../index" {
* @see _.filter
*/
filter(
this: LoDashImplicitWrapper<string | string[] | null | undefined>,
this: LoDashImplicitWrapper<string | null | undefined>,
predicate?: StringIterator<boolean>
): LoDashImplicitWrapper<string[]>;
@@ -299,7 +299,7 @@ declare module "../index" {
* @see _.filter
*/
filter(
this: LoDashExplicitWrapper<string | string[] | null | undefined>,
this: LoDashExplicitWrapper<string | null | undefined>,
predicate?: StringIterator<boolean>
): LoDashExplicitWrapper<string[]>;

View File

@@ -1766,7 +1766,7 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper<number
fp.filter("", dictionary); // $ExpectType AbcObject[]
fp.filter({ a: 42 }, dictionary); // $ExpectType AbcObject[]
fp.filter(["a", 42], dictionary); // $ExpectType AbcObject[]
fp.filter(Boolean)(["a", "b"]); // $ExpectType any[]
fp.filter((s: string) => s === "a")(["a", "b"]); // $ExpectType string[]
// Test filtering with type guard
const a2: Array<string | number> | null | undefined = anything;

View File

@@ -459,7 +459,7 @@ declare module "./index" {
predicate?: _.ObjectIterateeCustom<T, boolean>
): LoDashExplicitSyncWrapper<boolean>;
filter(
this: LoDashExplicitSyncWrapper<string | string[] | null | undefined>,
this: LoDashExplicitSyncWrapper<string | null | undefined>,
predicate?: _.StringIterator<boolean>
): LoDashExplicitSyncWrapper<string[]>;
filter<T, S extends T>(
@@ -2055,7 +2055,7 @@ declare module "./index" {
predicate?: _.ObjectIterateeCustom<T, boolean>
): LoDashExplicitAsyncWrapper<boolean>;
filter(
this: LoDashExplicitAsyncWrapper<string | string[] | null | undefined>,
this: LoDashExplicitAsyncWrapper<string | null | undefined>,
predicate?: _.StringIterator<boolean>
): LoDashExplicitAsyncWrapper<string[]>;
filter<T, S extends T>(