Skip to content

Commit c7d1fc8

Browse files
committed
feat(filterfirst): deprecate filterFirst function in favour of excludeFirst
This function is confusing. Use excludeFirst instead, and invert the predicate.
1 parent 94feefd commit c7d1fc8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ export function filterFn<T>(
325325
return array => nativeFilter.call(array, predicate) as T[];
326326
}
327327

328+
/** @deprecated This function is confusing, use {@link excludeFirst} instead,
329+
* and invert the predicate. */
328330
export function filterFirst<T>(
329331
array: ArrayLike<T>,
330332
predicate: (element: T, index: number) => boolean
@@ -345,6 +347,8 @@ export function filterFirst<T>(
345347
return result;
346348
}
347349

350+
/** @deprecated This function is confusing, use {@link excludeFirstFn} instead,
351+
* and invert the predicate. */
348352
export function filterFirstFn<T>(
349353
predicate: (element: T, index: number) => boolean
350354
): (array: ArrayLike<T>) => T[] {

0 commit comments

Comments
 (0)