-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49cf1c7
commit f5901af
Showing
1 changed file
with
3 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
export function reject<A, P extends A>( | ||
pred: (val: A) => val is P, | ||
): { | ||
<B extends A>(list: readonly B[]): Array<Exclude<B, P>>; | ||
<B extends A>(dict: Record<string, B>): Record<string, Exclude<B, P>>; | ||
<B extends A>(list: readonly B[]): Exclude<B, P>[]; | ||
}; | ||
export function reject<T>( | ||
pred: (value: T) => boolean, | ||
): <P extends T, C extends readonly P[] | Record<string, P>>(collection: C) => C; | ||
export function reject<A, B extends A, P extends A>( | ||
pred: (val: A) => val is P, | ||
list: readonly B[], | ||
): Array<Exclude<B, P>>; | ||
export function reject<A, B extends A, P extends A>( | ||
pred: (val: A) => val is P, | ||
dict: Record<string, B>, | ||
): Record<string, Exclude<B, P>>; | ||
export function reject<T, P extends T>(pred: (val: T) => val is P, dict: Record<string, T>): Record<string, Exclude<T, P>>; | ||
export function reject<T, P extends T>(pred: (val: T) => val is P, list: readonly T[]): Exclude<T, P>[]; | ||
export function reject<T, C extends readonly T[] | Record<string, T>>(pred: (value: T) => boolean, collection: C): C; |