Skip to content

Commit 4ca59f1

Browse files
committed
SOF-7010: remove sortArrayByOrder from wode.js/utils
1 parent f05099e commit 4ca59f1

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/utils.js

-12
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,3 @@ export function findUnit({ subworkflowData, index, type }) {
7171
if (unit.type !== type) throw new Error("findUnit() error: unit type does not match!");
7272
return unit;
7373
}
74-
75-
// Function to sort array based on the order given in a separate array
76-
export function sortArrayByOrder(arr, order) {
77-
const orderMap = new Map();
78-
order.forEach((item, index) => orderMap.set(item, index));
79-
80-
return arr.sort((a, b) => {
81-
const indexA = orderMap.has(a) ? orderMap.get(a) : order.length;
82-
const indexB = orderMap.has(b) ? orderMap.get(b) : order.length;
83-
return indexA - indexB;
84-
});
85-
}

0 commit comments

Comments
 (0)