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