We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 610d3ec commit b118fdeCopy full SHA for b118fde
index.ts
@@ -861,6 +861,19 @@ export function partitionWhileFn<T>(
861
return array => partitionWhile(array, predicate);
862
}
863
864
+export function partitionUntil<T>(
865
+ array: ArrayLike<T>,
866
+ predicate: (element: T) => boolean
867
+): [T[], T[]] {
868
+ return partitionWhile(array, element => !predicate(element));
869
+}
870
+
871
+export function partitionUntilFn<T>(
872
873
+): (array: ArrayLike<T>) => [T[], T[]] {
874
+ return array => partitionUntil(array, predicate);
875
876
877
/** Takes two arrays and returns an array of corresponding pairs.
878
*
879
* If one of the supplied arrays is shorter than the other, then the excess
0 commit comments