qmwts 1.1.73 → 1.1.75
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.
|
@@ -14,8 +14,11 @@ exports.default = {
|
|
|
14
14
|
const ids = []; // 记录所有的id,parentId不在这个集合内则说明是最上级
|
|
15
15
|
const length = array.length;
|
|
16
16
|
for (let i = 0; i < length; i++) {
|
|
17
|
-
const e = array[i]
|
|
18
|
-
|
|
17
|
+
const e = array[i];
|
|
18
|
+
if (e == null)
|
|
19
|
+
continue;
|
|
20
|
+
const id = e[idKey], pid = e[parentKey];
|
|
21
|
+
const children = map.get(pid) ?? [];
|
|
19
22
|
children.push(e);
|
|
20
23
|
map.set(pid, children);
|
|
21
24
|
ids.push(id);
|
|
@@ -107,7 +110,7 @@ exports.default = {
|
|
|
107
110
|
for (const fn of values) {
|
|
108
111
|
const valueA = fn(a);
|
|
109
112
|
const valueB = fn(b);
|
|
110
|
-
if (valueA !==
|
|
113
|
+
if (valueA - valueB !== 0)
|
|
111
114
|
return (valueA - valueB) * multiplier;
|
|
112
115
|
}
|
|
113
116
|
return 0;
|