Skip to content

Commit 110ae6a

Browse files
committed
refactor(isArrayLike): delete type parameter
BREAKING CHANGE: isArrayLike can no longer be called with a type parameter. This function was unsound when called with a type parameter. Code that relied on specifying the type parameter explicitly should be rewritten to validate the type of array elements by some other method.
1 parent f056517 commit 110ae6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function isArray(value: unknown): value is readonly unknown[];
5050
export const isArray: (value: unknown) => value is unknown[] = Array.isArray;
5151

5252
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
53-
export function isArrayLike<T>(value: ArrayLike<T> | unknown): value is ArrayLike<T> {
53+
export function isArrayLike(value: unknown): value is ArrayLike<unknown> {
5454
return (
5555
typeof value === "object" &&
5656
value != null &&

0 commit comments

Comments
 (0)