dlsjs 0.1.25 → 0.1.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.
- package/dist/dlsjs.cjs.js +1 -1
- package/dist/dlsjs.cjs.js.map +1 -1
- package/dist/dlsjs.esm.js +4 -2
- package/dist/dlsjs.esm.js.map +1 -1
- package/dist/dlsjs.umd.js +1 -1
- package/dist/dlsjs.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/core/ES/Tree.js +8 -1
package/dist/dlsjs.esm.js
CHANGED
|
@@ -4265,8 +4265,10 @@ function list2Tree(e, D = {}) {
|
|
|
4265
4265
|
parentId: "parentId",
|
|
4266
4266
|
useConcat: !1
|
|
4267
4267
|
}, D);
|
|
4268
|
-
if (e[0] && !e[0].hasOwnProperty(
|
|
4269
|
-
let { id: k, children: A, parentId: j, useConcat: M } = O
|
|
4268
|
+
if (e[0] && !e[0].hasOwnProperty(O.id)) return console.warn("数据非标准,未找到唯一标识字段,直接返回"), e;
|
|
4269
|
+
let { id: k, children: A, parentId: j, useConcat: M } = O;
|
|
4270
|
+
if (M === !1) for (let D of e) delete D[A];
|
|
4271
|
+
let N = /* @__PURE__ */ new Map(), P = [];
|
|
4270
4272
|
for (let D of e) {
|
|
4271
4273
|
let e = D[k];
|
|
4272
4274
|
D[A] || (D[A] = []), N.set(e, D);
|