mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add several more util functions and tests (#4106)
This commit is contained in:
1 parent
0aabc9a5de
commit
5abc1c618c
9 files changed
+132
-31
No files matched your search
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
import type { TableSortCallback } from "./table";
|
||||
import { array, Ordering, rectifyOrdering, sortCompare } from "../../utils";
|
||||
import { Ordering, rectifyOrdering, sortCompare, tuple } from "../../utils";
|
||||
|
||||
export function getSorted<T>(rawItems: T[], sortingCallback: TableSortCallback<T> | undefined, orderByRaw: string): T[] {
|
||||
if (typeof sortingCallback !== "function") {
|
||||
@@ -40,7 +40,7 @@ export function getSorted<T>(rawItems: T[], sortingCallback: TableSortCallback<T
|
||||
|
||||
const leftSortBy = [left.sortBy].flat();
|
||||
const rightSortBy = [right.sortBy].flat();
|
||||
const zipIter = array.zipStrict(leftSortBy, rightSortBy);
|
||||
const zipIter = tuple.zip(leftSortBy, rightSortBy);
|
||||
let r = zipIter.next();
|
||||
|
||||
for (; r.done === false; r = zipIter.next()) {
|
||||
|
||||
Reference in new issue
Block a user