From 5ed4c19b3cc2e096cf4a8765e021259a2ff071fc Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Sun, 29 Oct 2017 10:08:18 -0400 Subject: [PATCH] Add type alias for boolean | null | undefined --- types/lodash/index.d.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 254a411187..408e45a266 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -4321,7 +4321,7 @@ declare namespace _ { */ filter( collection: string | null | undefined, - predicate?: StringIterator + predicate?: StringIterator ): string[]; /** @@ -4363,7 +4363,7 @@ declare namespace _ { */ filter( this: LoDashImplicitWrapper, - predicate?: StringIterator + predicate?: StringIterator ): LoDashImplicitWrapper; /** @@ -4405,7 +4405,7 @@ declare namespace _ { */ filter( this: LoDashExplicitWrapper, - predicate?: StringIterator + predicate?: StringIterator ): LoDashExplicitWrapper; /** @@ -6458,7 +6458,7 @@ declare namespace _ { */ reject( collection: string | null | undefined, - predicate?: StringIterator + predicate?: StringIterator ): string[]; /** @@ -6484,7 +6484,7 @@ declare namespace _ { */ reject( this: LoDashImplicitWrapper, - predicate?: StringIterator + predicate?: StringIterator ): LoDashImplicitWrapper; /** @@ -6510,7 +6510,7 @@ declare namespace _ { */ reject( this: LoDashExplicitWrapper, - predicate?: StringIterator + predicate?: StringIterator ): LoDashExplicitWrapper; /** @@ -16590,16 +16590,17 @@ declare namespace _ { } type NotVoid = {} | null | undefined; + type Boolish = boolean | null | undefined; type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; type ListIterator = (value: T, index: number, collection: List) => TResult; type ListIteratee = ListIterator | string | [string, any] | PartialDeep; - type ListIterateeBoolean = ListIterator | string | [string, any] | PartialDeep; + type ListIterateeBoolean = ListIterator | string | [string, any] | PartialDeep; type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. type ObjectIterator = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult; type ObjectIteratee = ObjectIterator | string | [string, any] | PartialDeep; - type ObjectIterateeBoolean = ObjectIterator | string | [string, any] | PartialDeep; + type ObjectIterateeBoolean = ObjectIterator | string | [string, any] | PartialDeep; type ObjectIteratorTypeGuard = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S; type DictionaryIterator = ObjectIterator, TResult>; @@ -16608,7 +16609,7 @@ declare namespace _ { type NumericDictionaryIterator = (value: T, key: number, collection: NumericDictionary) => TResult; type NumericDictionaryIteratee = NumericDictionaryIterator | string | [string, any] | PartialDeep; - type NumericDictionaryIterateeBoolean = NumericDictionaryIterator | string | [string, any] | PartialDeep; + type NumericDictionaryIterateeBoolean = NumericDictionaryIterator | string | [string, any] | PartialDeep; type StringIterator = (char: string, index: number, string: string) => TResult; @@ -16624,8 +16625,8 @@ declare namespace _ { type ValueIteratee = ((value: T) => NotVoid) | string | [string, any] | PartialDeep; type ValueKeyIteratee = ((value: T, key: string) => NotVoid) | string | [string, any] | PartialDeep; - type Comparator = (a: T, b: T) => boolean | null | undefined; - type Comparator2 = (a: T1, b: T2) => boolean | null | undefined; + type Comparator = (a: T, b: T) => Boolish; + type Comparator2 = (a: T1, b: T2) => Boolish; type PropertyName = string | number; type PropertyPath = Many;