Skip to content

Commit 0bd21f7

Browse files
committed
feat(filterfirst): deprecate filterFirst function in favour of excludeFirst
This function is confusing. Use excludeFirst instead, and invert the predicate. (cherry picked from commit c7d1fc8)
1 parent b985d4e commit 0bd21f7

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
@@ -311,6 +311,8 @@ export function filterFn<T>(
311311
return array => filter(array, predicate);
312312
}
313313

314+
/** @deprecated This function is confusing, use {@link excludeFirst} instead,
315+
* and invert the predicate. */
314316
export function filterFirst<T>(
315317
array: ArrayLike<T>,
316318
predicate: (element: T, index: number) => boolean
@@ -331,6 +333,8 @@ export function filterFirst<T>(
331333
return result;
332334
}
333335

336+
/** @deprecated This function is confusing, use {@link excludeFirstFn} instead,
337+
* and invert the predicate. */
334338
export function filterFirstFn<T>(
335339
predicate: (element: T, index: number) => boolean
336340
): (array: ArrayLike<T>) => T[] {

0 commit comments

Comments
 (0)