@hpcc-js/util 2.42.0 → 2.46.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.
Files changed (75) hide show
  1. package/LICENSE +43 -43
  2. package/dist/index.js +2281 -2281
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/lib-es6/__package__.js +3 -3
  7. package/lib-es6/__package__.js.map +1 -1
  8. package/lib-es6/array.js +84 -84
  9. package/lib-es6/cache.js +60 -60
  10. package/lib-es6/debounce.js +85 -85
  11. package/lib-es6/dictionary.js +61 -61
  12. package/lib-es6/dispatch.js +101 -101
  13. package/lib-es6/esp.js +32 -32
  14. package/lib-es6/graph.js +348 -348
  15. package/lib-es6/graph2.js +603 -603
  16. package/lib-es6/hashSum.js +49 -49
  17. package/lib-es6/immutable.js +54 -54
  18. package/lib-es6/index.js +21 -21
  19. package/lib-es6/logging.js +177 -177
  20. package/lib-es6/math.js +90 -90
  21. package/lib-es6/object.js +121 -121
  22. package/lib-es6/observer.js +79 -79
  23. package/lib-es6/platform.js +17 -17
  24. package/lib-es6/saxParser.js +125 -125
  25. package/lib-es6/stack.js +41 -41
  26. package/lib-es6/stateful.js +170 -170
  27. package/lib-es6/string.js +22 -22
  28. package/lib-es6/url.js +32 -32
  29. package/package.json +7 -21
  30. package/src/__package__.ts +2 -2
  31. package/src/array.ts +98 -98
  32. package/src/cache.ts +65 -65
  33. package/src/debounce.ts +88 -88
  34. package/src/dictionary.ts +69 -69
  35. package/src/dispatch.ts +119 -119
  36. package/src/esp.ts +32 -32
  37. package/src/graph.ts +353 -353
  38. package/src/graph2.ts +661 -661
  39. package/src/hashSum.ts +55 -55
  40. package/src/immutable.ts +57 -57
  41. package/src/index.ts +21 -21
  42. package/src/logging.ts +211 -211
  43. package/src/math.ts +92 -92
  44. package/src/object.ts +117 -117
  45. package/src/observer.ts +91 -91
  46. package/src/platform.ts +20 -20
  47. package/src/saxParser.ts +135 -135
  48. package/src/stack.ts +41 -41
  49. package/src/stateful.ts +178 -178
  50. package/src/string.ts +21 -21
  51. package/src/url.ts +27 -27
  52. package/types/__package__.d.ts +3 -3
  53. package/types/__package__.d.ts.map +1 -1
  54. package/types/array.d.ts +13 -13
  55. package/types/cache.d.ts +20 -20
  56. package/types/debounce.d.ts +12 -12
  57. package/types/dictionary.d.ts +20 -20
  58. package/types/dispatch.d.ts +26 -26
  59. package/types/esp.d.ts +1 -1
  60. package/types/graph.d.ts +73 -73
  61. package/types/graph2.d.ts +111 -111
  62. package/types/hashSum.d.ts +1 -1
  63. package/types/immutable.d.ts +2 -2
  64. package/types/index.d.ts +21 -21
  65. package/types/logging.d.ts +57 -57
  66. package/types/math.d.ts +70 -70
  67. package/types/object.d.ts +48 -48
  68. package/types/observer.d.ts +18 -18
  69. package/types/platform.d.ts +5 -5
  70. package/types/saxParser.d.ts +28 -28
  71. package/types/stack.d.ts +28 -28
  72. package/types/stateful.d.ts +33 -33
  73. package/types/string.d.ts +2 -2
  74. package/types/url.d.ts +2 -2
  75. package/types-3.4/__package__.d.ts +2 -2
@@ -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