@equinor/cpl-utils 0.2.1 → 0.2.2
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/index.js +16 -1
- package/dist/index.mjs +19 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,21 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
6
20
|
var __export = (target, all) => {
|
|
7
21
|
for (var name in all)
|
|
8
22
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -73,7 +87,8 @@ function buildTreeNodes(items, idKey, parentIdKey, options = {}) {
|
|
|
73
87
|
if (!objectHasOwnProperty(item, idKey)) {
|
|
74
88
|
throw new Error(`Item is missing idKey named '${String(idKey)}'`);
|
|
75
89
|
}
|
|
76
|
-
|
|
90
|
+
const nodeCopy = __spreadValues({}, item);
|
|
91
|
+
lookupTable.set(item[idKey], nodeCopy);
|
|
77
92
|
}
|
|
78
93
|
const rootNodes = [];
|
|
79
94
|
for (const item of lookupTable.values()) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
1
18
|
// src/has-circular-dependency.ts
|
|
2
19
|
function hasCircularDependency(items, idKey, parentIdKey) {
|
|
3
20
|
const parentMap = /* @__PURE__ */ new Map();
|
|
@@ -43,7 +60,8 @@ function buildTreeNodes(items, idKey, parentIdKey, options = {}) {
|
|
|
43
60
|
if (!objectHasOwnProperty(item, idKey)) {
|
|
44
61
|
throw new Error(`Item is missing idKey named '${String(idKey)}'`);
|
|
45
62
|
}
|
|
46
|
-
|
|
63
|
+
const nodeCopy = __spreadValues({}, item);
|
|
64
|
+
lookupTable.set(item[idKey], nodeCopy);
|
|
47
65
|
}
|
|
48
66
|
const rootNodes = [];
|
|
49
67
|
for (const item of lookupTable.values()) {
|