Skip to content

Commit

Permalink
feat(dropuntil): add dropUntil function
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Jan 15, 2022
1 parent ae40041 commit 610d3ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ export function dropWhileFn<T>(
return array => dropWhile(array, predicate);
}

export function dropUntil<T>(
array: ArrayLike<T>,
predicate: (element: T, index: number) => boolean
): T[] {
return dropWhile(array, (element, index) => !predicate(element, index));
}

export function dropUntilFn<T>(
predicate: (element: T, index: number) => boolean
): (array: ArrayLike<T>) => T[] {
return array => dropWhile(array, predicate);
}

export function equal<T>(
a: ArrayLike<T>,
b: ArrayLike<T>,
Expand Down

0 comments on commit 610d3ec

Please sign in to comment.