@hpcc-js/util 3.3.9 → 3.3.10
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 +85 -94
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -129,14 +129,14 @@ function hashSum(o) {
|
|
|
129
129
|
}
|
|
130
130
|
__name(hashSum, "hashSum");
|
|
131
131
|
const _Cache = class _Cache {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
__publicField(this, "_calcID");
|
|
135
|
-
this._calcID = calcID;
|
|
136
|
-
}
|
|
132
|
+
_cache = {};
|
|
133
|
+
_calcID;
|
|
137
134
|
static hash(...args) {
|
|
138
135
|
return hashSum({ ...args });
|
|
139
136
|
}
|
|
137
|
+
constructor(calcID) {
|
|
138
|
+
this._calcID = calcID;
|
|
139
|
+
}
|
|
140
140
|
has(espObj) {
|
|
141
141
|
return this._calcID(espObj) in this._cache;
|
|
142
142
|
}
|
|
@@ -155,14 +155,14 @@ const _Cache = class _Cache {
|
|
|
155
155
|
__name(_Cache, "Cache");
|
|
156
156
|
let Cache = _Cache;
|
|
157
157
|
const _AsyncCache = class _AsyncCache {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
__publicField(this, "_calcID");
|
|
161
|
-
this._calcID = calcID;
|
|
162
|
-
}
|
|
158
|
+
_cache = {};
|
|
159
|
+
_calcID;
|
|
163
160
|
static hash(...args) {
|
|
164
161
|
return hashSum({ ...args });
|
|
165
162
|
}
|
|
163
|
+
constructor(calcID) {
|
|
164
|
+
this._calcID = calcID;
|
|
165
|
+
}
|
|
166
166
|
has(espObj) {
|
|
167
167
|
return this._calcID(espObj) in this._cache;
|
|
168
168
|
}
|
|
@@ -227,9 +227,7 @@ function promiseTimeout(ms, promise) {
|
|
|
227
227
|
}
|
|
228
228
|
__name(promiseTimeout, "promiseTimeout");
|
|
229
229
|
const _AsyncOrderedQueue = class _AsyncOrderedQueue {
|
|
230
|
-
|
|
231
|
-
__publicField(this, "_q", []);
|
|
232
|
-
}
|
|
230
|
+
_q = [];
|
|
233
231
|
isTop(p) {
|
|
234
232
|
return this._q[0] === p;
|
|
235
233
|
}
|
|
@@ -262,8 +260,8 @@ function sleep(ms) {
|
|
|
262
260
|
}
|
|
263
261
|
__name(sleep, "sleep");
|
|
264
262
|
const _Dictionary = class _Dictionary {
|
|
263
|
+
store = {};
|
|
265
264
|
constructor(attrs) {
|
|
266
|
-
__publicField(this, "store", {});
|
|
267
265
|
if (attrs) {
|
|
268
266
|
for (const key in attrs) {
|
|
269
267
|
this.set(key, attrs[key]);
|
|
@@ -352,21 +350,21 @@ function espTime2Seconds(duration) {
|
|
|
352
350
|
}
|
|
353
351
|
__name(espTime2Seconds, "espTime2Seconds");
|
|
354
352
|
let GraphItem$1 = (_a = class {
|
|
353
|
+
_graph;
|
|
354
|
+
parent;
|
|
355
|
+
props = {};
|
|
355
356
|
constructor(graph, parent) {
|
|
356
|
-
__publicField(this, "_graph");
|
|
357
|
-
__publicField(this, "parent");
|
|
358
|
-
__publicField(this, "props", {});
|
|
359
357
|
this._graph = graph;
|
|
360
358
|
this.parent = parent;
|
|
361
359
|
}
|
|
362
360
|
}, __name(_a, "GraphItem"), _a);
|
|
363
361
|
let Subgraph$1 = (_b = class extends GraphItem$1 {
|
|
362
|
+
subgraphs = [];
|
|
363
|
+
vertices = [];
|
|
364
|
+
edges = [];
|
|
365
|
+
_;
|
|
364
366
|
constructor(graph, parent, _) {
|
|
365
367
|
super(graph, parent);
|
|
366
|
-
__publicField(this, "subgraphs", []);
|
|
367
|
-
__publicField(this, "vertices", []);
|
|
368
|
-
__publicField(this, "edges", []);
|
|
369
|
-
__publicField(this, "_");
|
|
370
368
|
if (parent) {
|
|
371
369
|
parent._addSubgraph(this);
|
|
372
370
|
}
|
|
@@ -444,17 +442,17 @@ let Subgraph$1 = (_b = class extends GraphItem$1 {
|
|
|
444
442
|
}
|
|
445
443
|
}, __name(_b, "Subgraph"), _b);
|
|
446
444
|
let Vertex$1 = (_c = class extends GraphItem$1 {
|
|
445
|
+
inEdges = [];
|
|
446
|
+
outEdges = [];
|
|
447
|
+
get edges() {
|
|
448
|
+
return [...this.inEdges, ...this.outEdges];
|
|
449
|
+
}
|
|
450
|
+
_;
|
|
447
451
|
constructor(graph, parent, _) {
|
|
448
452
|
super(graph, parent);
|
|
449
|
-
__publicField(this, "inEdges", []);
|
|
450
|
-
__publicField(this, "outEdges", []);
|
|
451
|
-
__publicField(this, "_");
|
|
452
453
|
parent._addVertex(this);
|
|
453
454
|
this._ = _;
|
|
454
455
|
}
|
|
455
|
-
get edges() {
|
|
456
|
-
return [...this.inEdges, ...this.outEdges];
|
|
457
|
-
}
|
|
458
456
|
remove(full = true, _) {
|
|
459
457
|
return this._graph.removeVertex(this, full, _);
|
|
460
458
|
}
|
|
@@ -480,11 +478,11 @@ let Vertex$1 = (_c = class extends GraphItem$1 {
|
|
|
480
478
|
}
|
|
481
479
|
}, __name(_c, "Vertex"), _c);
|
|
482
480
|
let Edge$1 = (_d = class extends GraphItem$1 {
|
|
481
|
+
source;
|
|
482
|
+
target;
|
|
483
|
+
_;
|
|
483
484
|
constructor(graph, parent, source, target, _) {
|
|
484
485
|
super(graph, parent);
|
|
485
|
-
__publicField(this, "source");
|
|
486
|
-
__publicField(this, "target");
|
|
487
|
-
__publicField(this, "_");
|
|
488
486
|
if (!source) {
|
|
489
487
|
throw new Error("Missing source vertex");
|
|
490
488
|
}
|
|
@@ -503,15 +501,15 @@ let Edge$1 = (_d = class extends GraphItem$1 {
|
|
|
503
501
|
}
|
|
504
502
|
}, __name(_d, "Edge"), _d);
|
|
505
503
|
const _Graph = class _Graph {
|
|
504
|
+
root;
|
|
505
|
+
_allSubgraphs = [];
|
|
506
|
+
_allSubgraphsMap = {};
|
|
507
|
+
_allVertices = [];
|
|
508
|
+
_allVerticesMap = {};
|
|
509
|
+
_allEdges = [];
|
|
510
|
+
_allEdgesMap = {};
|
|
511
|
+
idOf;
|
|
506
512
|
constructor(idOf = (item) => "" + item._, _) {
|
|
507
|
-
__publicField(this, "root");
|
|
508
|
-
__publicField(this, "_allSubgraphs", []);
|
|
509
|
-
__publicField(this, "_allSubgraphsMap", {});
|
|
510
|
-
__publicField(this, "_allVertices", []);
|
|
511
|
-
__publicField(this, "_allVerticesMap", {});
|
|
512
|
-
__publicField(this, "_allEdges", []);
|
|
513
|
-
__publicField(this, "_allEdgesMap", {});
|
|
514
|
-
__publicField(this, "idOf");
|
|
515
513
|
this.root = new Subgraph$1(this, null, _);
|
|
516
514
|
this.idOf = idOf;
|
|
517
515
|
}
|
|
@@ -663,22 +661,22 @@ function ObjMap() {
|
|
|
663
661
|
}
|
|
664
662
|
__name(ObjMap, "ObjMap");
|
|
665
663
|
const _GraphItem = class _GraphItem {
|
|
664
|
+
_graph;
|
|
665
|
+
_;
|
|
666
|
+
id() {
|
|
667
|
+
return this._graph.id(this._);
|
|
668
|
+
}
|
|
666
669
|
constructor(g, _) {
|
|
667
|
-
__publicField(this, "_graph");
|
|
668
|
-
__publicField(this, "_");
|
|
669
670
|
this._graph = g;
|
|
670
671
|
this._ = _;
|
|
671
672
|
}
|
|
672
|
-
id() {
|
|
673
|
-
return this._graph.id(this._);
|
|
674
|
-
}
|
|
675
673
|
};
|
|
676
674
|
__name(_GraphItem, "GraphItem");
|
|
677
675
|
let GraphItem = _GraphItem;
|
|
678
676
|
const _ChildGraphItem = class _ChildGraphItem extends GraphItem {
|
|
677
|
+
_parent;
|
|
679
678
|
constructor(g, _) {
|
|
680
679
|
super(g, _);
|
|
681
|
-
__publicField(this, "_parent");
|
|
682
680
|
}
|
|
683
681
|
clearParent() {
|
|
684
682
|
if (this._parent) {
|
|
@@ -704,9 +702,9 @@ const _ChildGraphItem = class _ChildGraphItem extends GraphItem {
|
|
|
704
702
|
__name(_ChildGraphItem, "ChildGraphItem");
|
|
705
703
|
let ChildGraphItem = _ChildGraphItem;
|
|
706
704
|
const _Subgraph = class _Subgraph extends ChildGraphItem {
|
|
705
|
+
_children = [];
|
|
707
706
|
constructor(g, _) {
|
|
708
707
|
super(g, _);
|
|
709
|
-
__publicField(this, "_children", []);
|
|
710
708
|
}
|
|
711
709
|
children() {
|
|
712
710
|
return this._children;
|
|
@@ -721,10 +719,10 @@ const _Subgraph = class _Subgraph extends ChildGraphItem {
|
|
|
721
719
|
__name(_Subgraph, "Subgraph");
|
|
722
720
|
let Subgraph = _Subgraph;
|
|
723
721
|
const _Vertex = class _Vertex extends ChildGraphItem {
|
|
722
|
+
_inEdges = [];
|
|
723
|
+
_outEdges = [];
|
|
724
724
|
constructor(g, _) {
|
|
725
725
|
super(g, _);
|
|
726
|
-
__publicField(this, "_inEdges", []);
|
|
727
|
-
__publicField(this, "_outEdges", []);
|
|
728
726
|
}
|
|
729
727
|
edges() {
|
|
730
728
|
return [...this._inEdges, ...this._outEdges];
|
|
@@ -754,10 +752,10 @@ const _Vertex = class _Vertex extends ChildGraphItem {
|
|
|
754
752
|
__name(_Vertex, "Vertex");
|
|
755
753
|
let Vertex = _Vertex;
|
|
756
754
|
const _Edge = class _Edge extends ChildGraphItem {
|
|
755
|
+
_source;
|
|
756
|
+
_target;
|
|
757
757
|
constructor(g, _, source, target) {
|
|
758
758
|
super(g, _);
|
|
759
|
-
__publicField(this, "_source");
|
|
760
|
-
__publicField(this, "_target");
|
|
761
759
|
this._source = source;
|
|
762
760
|
this._target = target;
|
|
763
761
|
}
|
|
@@ -765,15 +763,11 @@ const _Edge = class _Edge extends ChildGraphItem {
|
|
|
765
763
|
__name(_Edge, "Edge");
|
|
766
764
|
let Edge = _Edge;
|
|
767
765
|
const _Graph2 = class _Graph2 {
|
|
766
|
+
_directed;
|
|
767
|
+
_subgraphMap = {};
|
|
768
|
+
_vertexMap = {};
|
|
769
|
+
_edgeMap = {};
|
|
768
770
|
constructor(directed = true) {
|
|
769
|
-
__publicField(this, "_directed");
|
|
770
|
-
__publicField(this, "_subgraphMap", {});
|
|
771
|
-
__publicField(this, "_vertexMap", {});
|
|
772
|
-
__publicField(this, "_edgeMap", {});
|
|
773
|
-
__publicField(this, "_idFunc", /* @__PURE__ */ __name((_) => typeof _.id === "function" ? _.id() : _.id, "_idFunc"));
|
|
774
|
-
__publicField(this, "_sourceFunc", /* @__PURE__ */ __name((_) => typeof _.source === "function" ? _.source() : _.source, "_sourceFunc"));
|
|
775
|
-
__publicField(this, "_targetFunc", /* @__PURE__ */ __name((_) => typeof _.target === "function" ? _.target() : _.target, "_targetFunc"));
|
|
776
|
-
__publicField(this, "_updateFunc", /* @__PURE__ */ __name((before, after) => after, "_updateFunc"));
|
|
777
771
|
this._directed = directed;
|
|
778
772
|
}
|
|
779
773
|
clear() {
|
|
@@ -794,18 +788,22 @@ const _Graph2 = class _Graph2 {
|
|
|
794
788
|
isDirected() {
|
|
795
789
|
return this._directed;
|
|
796
790
|
}
|
|
791
|
+
_idFunc = /* @__PURE__ */ __name((_) => typeof _.id === "function" ? _.id() : _.id, "_idFunc");
|
|
797
792
|
idFunc(_) {
|
|
798
793
|
this._idFunc = _;
|
|
799
794
|
return this;
|
|
800
795
|
}
|
|
796
|
+
_sourceFunc = /* @__PURE__ */ __name((_) => typeof _.source === "function" ? _.source() : _.source, "_sourceFunc");
|
|
801
797
|
sourceFunc(_) {
|
|
802
798
|
this._sourceFunc = _;
|
|
803
799
|
return this;
|
|
804
800
|
}
|
|
801
|
+
_targetFunc = /* @__PURE__ */ __name((_) => typeof _.target === "function" ? _.target() : _.target, "_targetFunc");
|
|
805
802
|
targetFunc(_) {
|
|
806
803
|
this._targetFunc = _;
|
|
807
804
|
return this;
|
|
808
805
|
}
|
|
806
|
+
_updateFunc = /* @__PURE__ */ __name((before, after) => after, "_updateFunc");
|
|
809
807
|
updateFunc(_) {
|
|
810
808
|
this._updateFunc = _;
|
|
811
809
|
return this;
|
|
@@ -1064,21 +1062,20 @@ const _Graph2 = class _Graph2 {
|
|
|
1064
1062
|
return this;
|
|
1065
1063
|
}
|
|
1066
1064
|
updateEdge(e) {
|
|
1067
|
-
var _a2, _b2, _c2, _d2;
|
|
1068
1065
|
const e_id = this._idFunc(e);
|
|
1069
1066
|
const edge = this._edgeMap[e_id];
|
|
1070
1067
|
if (!edge) throw new Error(`Edge '${e_id}' does not exist.`);
|
|
1071
1068
|
const old_source = edge._source.id();
|
|
1072
1069
|
const new_source = this._sourceFunc(e);
|
|
1073
1070
|
if (old_source !== new_source) {
|
|
1074
|
-
|
|
1075
|
-
|
|
1071
|
+
this._vertexMap[old_source]?.removeOutEdge(e_id);
|
|
1072
|
+
this._vertexMap[new_source]?.addOutEdge(edge);
|
|
1076
1073
|
}
|
|
1077
1074
|
const old_target = edge._target.id();
|
|
1078
1075
|
const new_target = this._targetFunc(e);
|
|
1079
1076
|
if (old_target !== new_target) {
|
|
1080
|
-
|
|
1081
|
-
|
|
1077
|
+
this._vertexMap[old_target]?.removeInEdge(e_id);
|
|
1078
|
+
this._vertexMap[new_target]?.addInEdge(edge);
|
|
1082
1079
|
}
|
|
1083
1080
|
edge._ = e;
|
|
1084
1081
|
edge._source = this._vertexMap[new_source];
|
|
@@ -1204,9 +1201,7 @@ const _Graph2 = class _Graph2 {
|
|
|
1204
1201
|
__name(_Graph2, "Graph2");
|
|
1205
1202
|
let Graph2 = _Graph2;
|
|
1206
1203
|
const _Set = class _Set {
|
|
1207
|
-
|
|
1208
|
-
__publicField(this, "_content", []);
|
|
1209
|
-
}
|
|
1204
|
+
_content = [];
|
|
1210
1205
|
get size() {
|
|
1211
1206
|
return this._content.length;
|
|
1212
1207
|
}
|
|
@@ -1383,9 +1378,7 @@ function getScriptSrc(partial) {
|
|
|
1383
1378
|
}
|
|
1384
1379
|
__name(getScriptSrc, "getScriptSrc");
|
|
1385
1380
|
const _Stack = class _Stack {
|
|
1386
|
-
|
|
1387
|
-
__publicField(this, "stack", []);
|
|
1388
|
-
}
|
|
1381
|
+
stack = [];
|
|
1389
1382
|
/**
|
|
1390
1383
|
* Push element onto the stack
|
|
1391
1384
|
*
|
|
@@ -1453,15 +1446,15 @@ const _ConsoleWriter = class _ConsoleWriter {
|
|
|
1453
1446
|
__name(_ConsoleWriter, "ConsoleWriter");
|
|
1454
1447
|
let ConsoleWriter = _ConsoleWriter;
|
|
1455
1448
|
const _Logging = class _Logging {
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
__publicField(this, "_writer", new ConsoleWriter());
|
|
1461
|
-
}
|
|
1449
|
+
_levelStack = new Stack();
|
|
1450
|
+
_level = 1;
|
|
1451
|
+
_filter = "";
|
|
1452
|
+
_writer = new ConsoleWriter();
|
|
1462
1453
|
static Instance() {
|
|
1463
1454
|
return this._instance || (this._instance = new this());
|
|
1464
1455
|
}
|
|
1456
|
+
constructor() {
|
|
1457
|
+
}
|
|
1465
1458
|
stringify(obj) {
|
|
1466
1459
|
const cache = [];
|
|
1467
1460
|
return JSON.stringify(obj, function(_key, value) {
|
|
@@ -1543,8 +1536,8 @@ __publicField(_Logging, "_instance");
|
|
|
1543
1536
|
let Logging = _Logging;
|
|
1544
1537
|
const logger = Logging.Instance();
|
|
1545
1538
|
const _ScopedLogging = class _ScopedLogging {
|
|
1539
|
+
_scopeID;
|
|
1546
1540
|
constructor(scopeID) {
|
|
1547
|
-
__publicField(this, "_scopeID");
|
|
1548
1541
|
this._scopeID = scopeID;
|
|
1549
1542
|
}
|
|
1550
1543
|
debug(msg) {
|
|
@@ -1700,10 +1693,10 @@ function classID2Meta(classID) {
|
|
|
1700
1693
|
}
|
|
1701
1694
|
__name(classID2Meta, "classID2Meta");
|
|
1702
1695
|
const _ObserverHandle = class _ObserverHandle {
|
|
1696
|
+
eventTarget;
|
|
1697
|
+
eventID;
|
|
1698
|
+
callback;
|
|
1703
1699
|
constructor(eventTarget, eventID, callback) {
|
|
1704
|
-
__publicField(this, "eventTarget");
|
|
1705
|
-
__publicField(this, "eventID");
|
|
1706
|
-
__publicField(this, "callback");
|
|
1707
1700
|
this.eventTarget = eventTarget;
|
|
1708
1701
|
this.eventID = eventID;
|
|
1709
1702
|
this.callback = callback;
|
|
@@ -1718,8 +1711,8 @@ const _ObserverHandle = class _ObserverHandle {
|
|
|
1718
1711
|
__name(_ObserverHandle, "ObserverHandle");
|
|
1719
1712
|
let ObserverHandle = _ObserverHandle;
|
|
1720
1713
|
const _Observable = class _Observable {
|
|
1714
|
+
_eventObservers = {};
|
|
1721
1715
|
constructor(...events) {
|
|
1722
|
-
__publicField(this, "_eventObservers", {});
|
|
1723
1716
|
}
|
|
1724
1717
|
addObserver(eventID, callback) {
|
|
1725
1718
|
let eventObservers = this._eventObservers[eventID];
|
|
@@ -1802,10 +1795,10 @@ const _Message = class _Message {
|
|
|
1802
1795
|
__name(_Message, "Message");
|
|
1803
1796
|
let Message = _Message;
|
|
1804
1797
|
const _Dispatch = class _Dispatch {
|
|
1798
|
+
_observerID = 0;
|
|
1799
|
+
_observers = [];
|
|
1800
|
+
_messageBuffer = [];
|
|
1805
1801
|
constructor() {
|
|
1806
|
-
__publicField(this, "_observerID", 0);
|
|
1807
|
-
__publicField(this, "_observers", []);
|
|
1808
|
-
__publicField(this, "_messageBuffer", []);
|
|
1809
1802
|
}
|
|
1810
1803
|
observers() {
|
|
1811
1804
|
return this._observers;
|
|
@@ -1862,11 +1855,11 @@ const _Dispatch = class _Dispatch {
|
|
|
1862
1855
|
__name(_Dispatch, "Dispatch");
|
|
1863
1856
|
let Dispatch = _Dispatch;
|
|
1864
1857
|
const _XMLNode = class _XMLNode {
|
|
1858
|
+
name = "";
|
|
1859
|
+
$ = {};
|
|
1860
|
+
_children = [];
|
|
1861
|
+
content = "";
|
|
1865
1862
|
constructor(name) {
|
|
1866
|
-
__publicField(this, "name", "");
|
|
1867
|
-
__publicField(this, "$", {});
|
|
1868
|
-
__publicField(this, "_children", []);
|
|
1869
|
-
__publicField(this, "content", "");
|
|
1870
1863
|
this.name = name;
|
|
1871
1864
|
}
|
|
1872
1865
|
appendAttribute(key, val) {
|
|
@@ -1890,9 +1883,9 @@ const _XMLNode = class _XMLNode {
|
|
|
1890
1883
|
__name(_XMLNode, "XMLNode");
|
|
1891
1884
|
let XMLNode = _XMLNode;
|
|
1892
1885
|
const _SAXStackParser = class _SAXStackParser {
|
|
1886
|
+
root;
|
|
1887
|
+
stack = new Stack();
|
|
1893
1888
|
constructor() {
|
|
1894
|
-
__publicField(this, "root");
|
|
1895
|
-
__publicField(this, "stack", new Stack());
|
|
1896
1889
|
}
|
|
1897
1890
|
walkDoc(node) {
|
|
1898
1891
|
const xmlNode = this._startXMLNode(node);
|
|
@@ -1993,12 +1986,10 @@ const _PropChangedMessage = class _PropChangedMessage extends Message {
|
|
|
1993
1986
|
__name(_PropChangedMessage, "PropChangedMessage");
|
|
1994
1987
|
let PropChangedMessage = _PropChangedMessage;
|
|
1995
1988
|
const _StateObject = class _StateObject {
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
__publicField(this, "_monitorTickCount", 0);
|
|
2001
|
-
}
|
|
1989
|
+
_espState = {};
|
|
1990
|
+
_dispatch = new Dispatch();
|
|
1991
|
+
_monitorHandle;
|
|
1992
|
+
_monitorTickCount = 0;
|
|
2002
1993
|
clear(newVals) {
|
|
2003
1994
|
this._espState = {};
|
|
2004
1995
|
if (newVals !== void 0) {
|