Skip to content

Typeguard-friendly Array#every #38262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/lib.es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,15 @@ interface ReadonlyArray<T> {
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns a value
* which is coercible to the Boolean value false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every<TValue extends T>(callbackfn: (value: T, index: number, array: readonly T[]) => value is TValue, thisArg?: any): this is readonly TValue[];
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls
Expand Down Expand Up @@ -1308,6 +1317,15 @@ interface Array<T> {
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns a value
* which is coercible to the Boolean value false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every<TValue extends T>(callbackfn: (value: T, index: number, array: T[]) => value is TValue, thisArg?: any): this is TValue[];
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls
Expand Down
18 changes: 18 additions & 0 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,15 @@ interface ReadonlyArray<T> {
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns a value
* which is coercible to the Boolean value false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every<TValue extends T>(callbackfn: (value: T, index: number, array: readonly T[]) => value is TValue, thisArg?: any): this is readonly TValue[];
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls
Expand Down Expand Up @@ -1288,6 +1297,15 @@ interface Array<T> {
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
/**
* Determines whether all the members of an array satisfy the specified test.
* @param callbackfn A function that accepts up to three arguments. The every method calls
* the callbackfn function for each element in the array until the callbackfn returns a value
* which is coercible to the Boolean value false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every<TValue extends T>(callbackfn: (value: T, index: number, array: T[]) => value is TValue, thisArg?: any): this is TValue[];
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls
Expand Down