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.
2 parents 0652ab3 + b118fde commit 771cba6Copy full SHA for 771cba6
index.ts
@@ -863,6 +863,19 @@ export function partitionWhileFn<T>(
863
return array => partitionWhile(array, predicate);
864
}
865
866
+export function partitionUntil<T>(
867
+ array: ArrayLike<T>,
868
+ predicate: (element: T) => boolean
869
+): [T[], T[]] {
870
+ return partitionWhile(array, element => !predicate(element));
871
+}
872
+
873
+export function partitionUntilFn<T>(
874
875
+): (array: ArrayLike<T>) => [T[], T[]] {
876
+ return array => partitionUntil(array, predicate);
877
878
879
/** Takes two arrays and returns an array of corresponding pairs.
880
*
881
* If one of the supplied arrays is shorter than the other, then the excess
0 commit comments