Skip to content

Commit

Permalink
Simplify typings for Array.every
Browse files Browse the repository at this point in the history
  • Loading branch information
feathecutie committed Dec 19, 2023
1 parent 2f5a0bd commit b01f302
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/entrypoints/every-boolean.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/// <reference path="utils.d.ts" />

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

interface ReadonlyArray<T> {
every<U>(
every(
predicate: BooleanConstructor,
thisArg?: any,
): this is this extends U[]
): this is this extends T[]
? TSReset.NonFalsy<T>[]
: this[number] extends TSReset.NonFalsy<T>
? this
Expand Down

0 comments on commit b01f302

Please sign in to comment.