@unchainedshop/core-assortments 4.8.24 → 4.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,5 +59,18 @@ export default (tree) => {
|
|
|
59
59
|
const levels = divideTreeByLevels(tree);
|
|
60
60
|
const concattedLevels = concatItemsByLevels(levels);
|
|
61
61
|
const items = shuffleEachLevel(concattedLevels);
|
|
62
|
-
|
|
62
|
+
const result = [];
|
|
63
|
+
const stack = [...items].reverse();
|
|
64
|
+
while (stack.length > 0) {
|
|
65
|
+
const value = stack.pop();
|
|
66
|
+
if (Array.isArray(value)) {
|
|
67
|
+
for (let i = value.length - 1; i >= 0; i--) {
|
|
68
|
+
stack.push(value[i]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (value) {
|
|
72
|
+
result.push(value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
63
76
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-assortments",
|
|
3
3
|
"description": "Assortment and category management module for the Unchained Engine",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.26",
|
|
5
5
|
"main": "lib/assortments-index.js",
|
|
6
6
|
"types": "lib/assortments-index.d.ts",
|
|
7
7
|
"type": "module",
|