@hpcc-js/util 2.46.1 → 2.47.1
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/LICENSE +43 -43
- package/dist/index.js +2373 -2281
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/lib-es6/__package__.js +3 -3
- package/lib-es6/array.js +84 -84
- package/lib-es6/cache.js +60 -60
- package/lib-es6/debounce.js +85 -85
- package/lib-es6/dictionary.js +61 -61
- package/lib-es6/dispatch.js +101 -101
- package/lib-es6/esp.js +32 -32
- package/lib-es6/graph.js +348 -348
- package/lib-es6/graph2.js +603 -603
- package/lib-es6/hashSum.js +49 -49
- package/lib-es6/immutable.js +144 -54
- package/lib-es6/immutable.js.map +1 -1
- package/lib-es6/index.js +21 -21
- package/lib-es6/logging.js +178 -177
- package/lib-es6/logging.js.map +1 -1
- package/lib-es6/math.js +90 -90
- package/lib-es6/object.js +121 -121
- package/lib-es6/observer.js +79 -79
- package/lib-es6/platform.js +17 -17
- package/lib-es6/saxParser.js +125 -125
- package/lib-es6/stack.js +41 -41
- package/lib-es6/stateful.js +170 -170
- package/lib-es6/string.js +22 -22
- package/lib-es6/url.js +32 -32
- package/package.json +3 -3
- package/src/__package__.ts +2 -2
- package/src/array.ts +98 -98
- package/src/cache.ts +65 -65
- package/src/debounce.ts +88 -88
- package/src/dictionary.ts +69 -69
- package/src/dispatch.ts +119 -119
- package/src/esp.ts +32 -32
- package/src/graph.ts +353 -353
- package/src/graph2.ts +661 -661
- package/src/hashSum.ts +55 -55
- package/src/immutable.ts +156 -57
- package/src/index.ts +21 -21
- package/src/logging.ts +212 -211
- package/src/math.ts +92 -92
- package/src/object.ts +117 -117
- package/src/observer.ts +91 -91
- package/src/platform.ts +20 -20
- package/src/saxParser.ts +135 -135
- package/src/stack.ts +41 -41
- package/src/stateful.ts +178 -178
- package/src/string.ts +21 -21
- package/src/url.ts +27 -27
- package/types/__package__.d.ts +3 -3
- package/types/array.d.ts +13 -13
- package/types/cache.d.ts +20 -20
- package/types/debounce.d.ts +12 -12
- package/types/dictionary.d.ts +20 -20
- package/types/dispatch.d.ts +26 -26
- package/types/dispatch.d.ts.map +1 -1
- package/types/esp.d.ts +1 -1
- package/types/graph.d.ts +73 -73
- package/types/graph2.d.ts +111 -111
- package/types/hashSum.d.ts +1 -1
- package/types/immutable.d.ts +3 -2
- package/types/immutable.d.ts.map +1 -1
- package/types/index.d.ts +21 -21
- package/types/logging.d.ts +57 -57
- package/types/logging.d.ts.map +1 -1
- package/types/math.d.ts +70 -70
- package/types/object.d.ts +48 -48
- package/types/observer.d.ts +18 -18
- package/types/platform.d.ts +5 -5
- package/types/saxParser.d.ts +28 -28
- package/types/stack.d.ts +28 -28
- package/types/stateful.d.ts +33 -33
- package/types/string.d.ts +2 -2
- package/types/url.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/immutable.d.ts +1 -0
package/lib-es6/dispatch.js
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { root } from "./platform";
|
|
2
|
-
var requestAnimationFrame;
|
|
3
|
-
// let cancelAnimationFrame: CancelAnimationFrame;
|
|
4
|
-
(function () {
|
|
5
|
-
if (root.requestAnimationFrame) {
|
|
6
|
-
requestAnimationFrame = root.requestAnimationFrame;
|
|
7
|
-
// cancelAnimationFrame = root.cancelAnimationFrame;
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
var lastTime_1 = 0;
|
|
11
|
-
requestAnimationFrame = function (callback) {
|
|
12
|
-
var currTime = new Date().getTime();
|
|
13
|
-
var timeToCall = Math.max(0, 16 - (currTime - lastTime_1));
|
|
14
|
-
var id = setTimeout(function () { return callback(currTime + timeToCall); }, timeToCall);
|
|
15
|
-
lastTime_1 = currTime + timeToCall;
|
|
16
|
-
return id;
|
|
17
|
-
};
|
|
18
|
-
// cancelAnimationFrame = function (handle: number): void {
|
|
19
|
-
// clearTimeout(handle);
|
|
20
|
-
// };
|
|
21
|
-
}
|
|
22
|
-
})();
|
|
23
|
-
var Message = /** @class */ (function () {
|
|
24
|
-
function Message() {
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(Message.prototype, "canConflate", {
|
|
27
|
-
get: function () { return false; },
|
|
28
|
-
enumerable: false,
|
|
29
|
-
configurable: true
|
|
30
|
-
});
|
|
31
|
-
Message.prototype.conflate = function (other) {
|
|
32
|
-
return false;
|
|
33
|
-
};
|
|
34
|
-
Message.prototype.void = function () {
|
|
35
|
-
return false;
|
|
36
|
-
};
|
|
37
|
-
return Message;
|
|
38
|
-
}());
|
|
39
|
-
export { Message };
|
|
40
|
-
var Dispatch = /** @class */ (function () {
|
|
41
|
-
function Dispatch() {
|
|
42
|
-
this._observerID = 0;
|
|
43
|
-
this._observers = [];
|
|
44
|
-
this._messageBuffer = [];
|
|
45
|
-
}
|
|
46
|
-
Dispatch.prototype.observers = function () {
|
|
47
|
-
return this._observers;
|
|
48
|
-
};
|
|
49
|
-
Dispatch.prototype.messages = function () {
|
|
50
|
-
var retVal = [];
|
|
51
|
-
this._messageBuffer.forEach(function (msg) {
|
|
52
|
-
if (!retVal.some(function (msg2) { return msg2.canConflate && msg2.conflate(msg); })) {
|
|
53
|
-
retVal.push(msg);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return retVal;
|
|
57
|
-
};
|
|
58
|
-
Dispatch.prototype.dispatchAll = function () {
|
|
59
|
-
this.dispatch(this.messages());
|
|
60
|
-
this.flush();
|
|
61
|
-
};
|
|
62
|
-
Dispatch.prototype.dispatch = function (messages) {
|
|
63
|
-
if (messages.length === 0)
|
|
64
|
-
return;
|
|
65
|
-
this.observers().forEach(function (o) {
|
|
66
|
-
var msgs = messages.filter(function (m) { return !m.void() && (o.type === undefined || m instanceof o.type); });
|
|
67
|
-
if (msgs.length) {
|
|
68
|
-
o.callback(msgs);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
Dispatch.prototype.hasObserver = function () {
|
|
73
|
-
return this._observers.length > 0;
|
|
74
|
-
};
|
|
75
|
-
Dispatch.prototype.flush = function () {
|
|
76
|
-
this._messageBuffer = [];
|
|
77
|
-
};
|
|
78
|
-
Dispatch.prototype.send = function (msg) {
|
|
79
|
-
this.dispatch([msg]);
|
|
80
|
-
};
|
|
81
|
-
Dispatch.prototype.post = function (msg) {
|
|
82
|
-
var _this = this;
|
|
83
|
-
this._messageBuffer.push(msg);
|
|
84
|
-
requestAnimationFrame(function () { return _this.dispatchAll(); });
|
|
85
|
-
};
|
|
86
|
-
Dispatch.prototype.attach = function (callback, type) {
|
|
87
|
-
var context = this;
|
|
88
|
-
var id = ++this._observerID;
|
|
89
|
-
this._observers.push({ id: id, type: type, callback: callback });
|
|
90
|
-
return {
|
|
91
|
-
release: function () {
|
|
92
|
-
context._observers = context._observers.filter(function (o) { return o.id !== id; });
|
|
93
|
-
},
|
|
94
|
-
unwatch: function () {
|
|
95
|
-
this.release();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
return Dispatch;
|
|
100
|
-
}());
|
|
101
|
-
export { Dispatch };
|
|
1
|
+
import { root } from "./platform";
|
|
2
|
+
var requestAnimationFrame;
|
|
3
|
+
// let cancelAnimationFrame: CancelAnimationFrame;
|
|
4
|
+
(function () {
|
|
5
|
+
if (root.requestAnimationFrame) {
|
|
6
|
+
requestAnimationFrame = root.requestAnimationFrame;
|
|
7
|
+
// cancelAnimationFrame = root.cancelAnimationFrame;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
var lastTime_1 = 0;
|
|
11
|
+
requestAnimationFrame = function (callback) {
|
|
12
|
+
var currTime = new Date().getTime();
|
|
13
|
+
var timeToCall = Math.max(0, 16 - (currTime - lastTime_1));
|
|
14
|
+
var id = setTimeout(function () { return callback(currTime + timeToCall); }, timeToCall);
|
|
15
|
+
lastTime_1 = currTime + timeToCall;
|
|
16
|
+
return id;
|
|
17
|
+
};
|
|
18
|
+
// cancelAnimationFrame = function (handle: number): void {
|
|
19
|
+
// clearTimeout(handle);
|
|
20
|
+
// };
|
|
21
|
+
}
|
|
22
|
+
})();
|
|
23
|
+
var Message = /** @class */ (function () {
|
|
24
|
+
function Message() {
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(Message.prototype, "canConflate", {
|
|
27
|
+
get: function () { return false; },
|
|
28
|
+
enumerable: false,
|
|
29
|
+
configurable: true
|
|
30
|
+
});
|
|
31
|
+
Message.prototype.conflate = function (other) {
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
Message.prototype.void = function () {
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
return Message;
|
|
38
|
+
}());
|
|
39
|
+
export { Message };
|
|
40
|
+
var Dispatch = /** @class */ (function () {
|
|
41
|
+
function Dispatch() {
|
|
42
|
+
this._observerID = 0;
|
|
43
|
+
this._observers = [];
|
|
44
|
+
this._messageBuffer = [];
|
|
45
|
+
}
|
|
46
|
+
Dispatch.prototype.observers = function () {
|
|
47
|
+
return this._observers;
|
|
48
|
+
};
|
|
49
|
+
Dispatch.prototype.messages = function () {
|
|
50
|
+
var retVal = [];
|
|
51
|
+
this._messageBuffer.forEach(function (msg) {
|
|
52
|
+
if (!retVal.some(function (msg2) { return msg2.canConflate && msg2.conflate(msg); })) {
|
|
53
|
+
retVal.push(msg);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return retVal;
|
|
57
|
+
};
|
|
58
|
+
Dispatch.prototype.dispatchAll = function () {
|
|
59
|
+
this.dispatch(this.messages());
|
|
60
|
+
this.flush();
|
|
61
|
+
};
|
|
62
|
+
Dispatch.prototype.dispatch = function (messages) {
|
|
63
|
+
if (messages.length === 0)
|
|
64
|
+
return;
|
|
65
|
+
this.observers().forEach(function (o) {
|
|
66
|
+
var msgs = messages.filter(function (m) { return !m.void() && (o.type === undefined || m instanceof o.type); });
|
|
67
|
+
if (msgs.length) {
|
|
68
|
+
o.callback(msgs);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
Dispatch.prototype.hasObserver = function () {
|
|
73
|
+
return this._observers.length > 0;
|
|
74
|
+
};
|
|
75
|
+
Dispatch.prototype.flush = function () {
|
|
76
|
+
this._messageBuffer = [];
|
|
77
|
+
};
|
|
78
|
+
Dispatch.prototype.send = function (msg) {
|
|
79
|
+
this.dispatch([msg]);
|
|
80
|
+
};
|
|
81
|
+
Dispatch.prototype.post = function (msg) {
|
|
82
|
+
var _this = this;
|
|
83
|
+
this._messageBuffer.push(msg);
|
|
84
|
+
requestAnimationFrame(function () { return _this.dispatchAll(); });
|
|
85
|
+
};
|
|
86
|
+
Dispatch.prototype.attach = function (callback, type) {
|
|
87
|
+
var context = this;
|
|
88
|
+
var id = ++this._observerID;
|
|
89
|
+
this._observers.push({ id: id, type: type, callback: callback });
|
|
90
|
+
return {
|
|
91
|
+
release: function () {
|
|
92
|
+
context._observers = context._observers.filter(function (o) { return o.id !== id; });
|
|
93
|
+
},
|
|
94
|
+
unwatch: function () {
|
|
95
|
+
this.release();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
return Dispatch;
|
|
100
|
+
}());
|
|
101
|
+
export { Dispatch };
|
|
102
102
|
//# sourceMappingURL=dispatch.js.map
|
package/lib-es6/esp.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
export function espTime2Seconds(duration) {
|
|
2
|
-
if (!duration) {
|
|
3
|
-
return 0;
|
|
4
|
-
}
|
|
5
|
-
else {
|
|
6
|
-
if (!isNaN(Number(duration))) {
|
|
7
|
-
return Number(duration);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
// GH: <n>ns or <m>ms or <s>s or [<d> days ][<h>:][<m>:]<s>[.<ms>]
|
|
11
|
-
var nsIndex = duration.indexOf("ns");
|
|
12
|
-
if (nsIndex !== -1) {
|
|
13
|
-
return parseFloat(duration.substr(0, nsIndex)) / 1000000000;
|
|
14
|
-
}
|
|
15
|
-
var msIndex = duration.indexOf("ms");
|
|
16
|
-
if (msIndex !== -1) {
|
|
17
|
-
return parseFloat(duration.substr(0, msIndex)) / 1000;
|
|
18
|
-
}
|
|
19
|
-
var sIndex = duration.indexOf("s");
|
|
20
|
-
if (sIndex !== -1 && duration.indexOf("days") === -1) {
|
|
21
|
-
return parseFloat(duration.substr(0, sIndex));
|
|
22
|
-
}
|
|
23
|
-
var dayTimeParts = duration.split(" days ");
|
|
24
|
-
var days = dayTimeParts.length > 1 ? parseFloat(dayTimeParts[0]) : 0.0;
|
|
25
|
-
var time = dayTimeParts.length > 1 ? dayTimeParts[1] : dayTimeParts[0];
|
|
26
|
-
var secs = 0.0;
|
|
27
|
-
var timeParts = time.split(":").reverse();
|
|
28
|
-
for (var j = 0; j < timeParts.length; ++j) {
|
|
29
|
-
secs += parseFloat(timeParts[j]) * Math.pow(60, j);
|
|
30
|
-
}
|
|
31
|
-
return (days * 24 * 60 * 60) + secs;
|
|
32
|
-
}
|
|
1
|
+
export function espTime2Seconds(duration) {
|
|
2
|
+
if (!duration) {
|
|
3
|
+
return 0;
|
|
4
|
+
}
|
|
5
|
+
else {
|
|
6
|
+
if (!isNaN(Number(duration))) {
|
|
7
|
+
return Number(duration);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
// GH: <n>ns or <m>ms or <s>s or [<d> days ][<h>:][<m>:]<s>[.<ms>]
|
|
11
|
+
var nsIndex = duration.indexOf("ns");
|
|
12
|
+
if (nsIndex !== -1) {
|
|
13
|
+
return parseFloat(duration.substr(0, nsIndex)) / 1000000000;
|
|
14
|
+
}
|
|
15
|
+
var msIndex = duration.indexOf("ms");
|
|
16
|
+
if (msIndex !== -1) {
|
|
17
|
+
return parseFloat(duration.substr(0, msIndex)) / 1000;
|
|
18
|
+
}
|
|
19
|
+
var sIndex = duration.indexOf("s");
|
|
20
|
+
if (sIndex !== -1 && duration.indexOf("days") === -1) {
|
|
21
|
+
return parseFloat(duration.substr(0, sIndex));
|
|
22
|
+
}
|
|
23
|
+
var dayTimeParts = duration.split(" days ");
|
|
24
|
+
var days = dayTimeParts.length > 1 ? parseFloat(dayTimeParts[0]) : 0.0;
|
|
25
|
+
var time = dayTimeParts.length > 1 ? dayTimeParts[1] : dayTimeParts[0];
|
|
26
|
+
var secs = 0.0;
|
|
27
|
+
var timeParts = time.split(":").reverse();
|
|
28
|
+
for (var j = 0; j < timeParts.length; ++j) {
|
|
29
|
+
secs += parseFloat(timeParts[j]) * Math.pow(60, j);
|
|
30
|
+
}
|
|
31
|
+
return (days * 24 * 60 * 60) + secs;
|
|
32
|
+
}
|
|
33
33
|
//# sourceMappingURL=esp.js.map
|