Skip to content

Commit

Permalink
Fixed Array.every improvements breaking existing code
Browse files Browse the repository at this point in the history
  • Loading branch information
feathecutie committed Dec 19, 2023
1 parent b01f302 commit f1538ca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/entrypoints/every-boolean.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/// <reference path="utils.d.ts" />

interface Array<T> {
every(
every<S extends T>(
predicate: BooleanConstructor,
thisArg?: any,
): this is this extends T[]
? TSReset.NonFalsy<T>[]
: this[number] extends TSReset.NonFalsy<T>
): this is this extends S[]
? TSReset.NonFalsy<S>[]
: this[number] extends TSReset.NonFalsy<S>
? this
: never;
}

interface ReadonlyArray<T> {
every(
every<S extends T>(
predicate: BooleanConstructor,
thisArg?: any,
): this is this extends T[]
? TSReset.NonFalsy<T>[]
: this[number] extends TSReset.NonFalsy<T>
): this is this extends S[]
? TSReset.NonFalsy<S>[]
: this[number] extends TSReset.NonFalsy<S>
? this
: never;
}

0 comments on commit f1538ca

Please sign in to comment.