@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
package/types/math.d.ts CHANGED
@@ -1,71 +1,71 @@
1
- /**
2
- * degreesToRadians - converts degrees to radians
3
- * Usage: degreesToRadians(1080);
4
- *
5
- * @param degrees
6
- * @returns Number radians
7
- */
8
- export declare function degreesToRadians(degrees: number): number;
9
- /**
10
- * radiansToDegrees - converts radians to degrees
11
- * Usage: radiansToDegrees(7);
12
- *
13
- * @param radians
14
- * @returns Number degreees
15
- */
16
- export declare function radiansToDegrees(radians: number): number;
17
- /**
18
- * polarToCartesian - converts (r, theta) to {x, y}
19
- * Usage: polarToCartesian(5, Math.PI);
20
- *
21
- * @param r radius
22
- * @param theta angle in radians
23
- * @returns { x: number, y: number }
24
- */
25
- export declare function polarToCartesian(r: number, theta: number): {
26
- x: number;
27
- y: number;
28
- };
29
- /**
30
- * cartesianToPolar - converts (x, y) to {r, theta}
31
- * Usage: cartesianToPolar(100, 200);
32
- *
33
- * @param x
34
- * @param y
35
- * @returns { r: number, theta: number }
36
- */
37
- export declare function cartesianToPolar(x: number, y: number): {
38
- r: number;
39
- theta: number;
40
- };
41
- /**
42
- * normalizeRadians - normalizes a radian value to within the provided range
43
- * Usage: normalizeRadians(7);
44
- *
45
- * @param radians value to be normalized
46
- * @param min lower limit
47
- * @param max upper limit
48
- * @returns Number normalized to within the provided range
49
- */
50
- export declare function normalizeRadians(radians: number, min?: number, max?: number): number;
51
- /**
52
- * normalizeDegrees - normalizes a degree value to within the provided range
53
- * Usage: normalizeDegrees(1080);
54
- *
55
- * @param degrees value to be normalized
56
- * @param min lower limit
57
- * @param max upper limit
58
- * @returns Number normalized to within the provided range
59
- */
60
- export declare function normalizeDegrees(degrees: number, min?: number, max?: number): number;
61
- /**
62
- * normalize - normalizes a value to within the provided range
63
- * Usage: normalize(1000, 0, 365);
64
- *
65
- * @param value value to be normalized
66
- * @param min lower limit
67
- * @param max upper limit
68
- * @returns Number normalized to within the provided range
69
- */
70
- export declare function normalize(value: number, min: number, max: number): number;
1
+ /**
2
+ * degreesToRadians - converts degrees to radians
3
+ * Usage: degreesToRadians(1080);
4
+ *
5
+ * @param degrees
6
+ * @returns Number radians
7
+ */
8
+ export declare function degreesToRadians(degrees: number): number;
9
+ /**
10
+ * radiansToDegrees - converts radians to degrees
11
+ * Usage: radiansToDegrees(7);
12
+ *
13
+ * @param radians
14
+ * @returns Number degreees
15
+ */
16
+ export declare function radiansToDegrees(radians: number): number;
17
+ /**
18
+ * polarToCartesian - converts (r, theta) to {x, y}
19
+ * Usage: polarToCartesian(5, Math.PI);
20
+ *
21
+ * @param r radius
22
+ * @param theta angle in radians
23
+ * @returns { x: number, y: number }
24
+ */
25
+ export declare function polarToCartesian(r: number, theta: number): {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ /**
30
+ * cartesianToPolar - converts (x, y) to {r, theta}
31
+ * Usage: cartesianToPolar(100, 200);
32
+ *
33
+ * @param x
34
+ * @param y
35
+ * @returns { r: number, theta: number }
36
+ */
37
+ export declare function cartesianToPolar(x: number, y: number): {
38
+ r: number;
39
+ theta: number;
40
+ };
41
+ /**
42
+ * normalizeRadians - normalizes a radian value to within the provided range
43
+ * Usage: normalizeRadians(7);
44
+ *
45
+ * @param radians value to be normalized
46
+ * @param min lower limit
47
+ * @param max upper limit
48
+ * @returns Number normalized to within the provided range
49
+ */
50
+ export declare function normalizeRadians(radians: number, min?: number, max?: number): number;
51
+ /**
52
+ * normalizeDegrees - normalizes a degree value to within the provided range
53
+ * Usage: normalizeDegrees(1080);
54
+ *
55
+ * @param degrees value to be normalized
56
+ * @param min lower limit
57
+ * @param max upper limit
58
+ * @returns Number normalized to within the provided range
59
+ */
60
+ export declare function normalizeDegrees(degrees: number, min?: number, max?: number): number;
61
+ /**
62
+ * normalize - normalizes a value to within the provided range
63
+ * Usage: normalize(1000, 0, 365);
64
+ *
65
+ * @param value value to be normalized
66
+ * @param min lower limit
67
+ * @param max upper limit
68
+ * @returns Number normalized to within the provided range
69
+ */
70
+ export declare function normalize(value: number, min: number, max: number): number;
71
71
  //# sourceMappingURL=math.d.ts.map
package/types/object.d.ts CHANGED
@@ -1,49 +1,49 @@
1
- /**
2
- * inner - return inner property of Object
3
- * Usage: inner("some.prop.to.locate", obj);
4
- *
5
- * @param prop - property to locate
6
- * @param obj - object to locate property in
7
- */
8
- export declare function inner(prop: string, obj: any): any;
9
- /**
10
- * exists - return true if inner property of Object exists
11
- * Usage: exists("some.prop.to.locate", obj);
12
- *
13
- * @param prop - property to locate
14
- * @param obj - object to locate property in
15
- */
16
- export declare function exists(prop: string, obj: any): boolean;
17
- /**
18
- * deepMixin - combine several objects from right to left
19
- * Usage: deepMixin({a: "a"}, {b: "b"});
20
- *
21
- * @param dest - target object to mix into.
22
- * @param sources - objects to mix in
23
- */
24
- export declare function deepMixin(dest?: any, ...sources: any[]): any;
25
- /**
26
- * deepMixinT - combine several objects of Partial<T> from right to left
27
- * Usage: deepMixinT<MyInterface>({a: "a"}, {b: "b"});
28
- *
29
- * Note: Only provided as a convenience, so user gets auto completion based on destination type.
30
- *
31
- * @param dest - target object to mix into.
32
- * @param sources - objects to mix in
33
- */
34
- export declare function deepMixinT<T>(dest?: Partial<T>, ...sources: Array<Partial<T>>): T;
35
- /**
36
- * safeStingify - JSONsimilar to .stringify, except ignores circular references.
37
- * Usage: safeStingify(object);
38
- *
39
- * @param obj - any object.
40
- */
41
- export declare function safeStringify(obj: object): string;
42
- export declare function isArray(arg: any): arg is any[];
43
- export interface ClassMeta {
44
- module: string;
45
- file: string;
46
- class: string;
47
- }
48
- export declare function classID2Meta(classID: string): ClassMeta;
1
+ /**
2
+ * inner - return inner property of Object
3
+ * Usage: inner("some.prop.to.locate", obj);
4
+ *
5
+ * @param prop - property to locate
6
+ * @param obj - object to locate property in
7
+ */
8
+ export declare function inner(prop: string, obj: any): any;
9
+ /**
10
+ * exists - return true if inner property of Object exists
11
+ * Usage: exists("some.prop.to.locate", obj);
12
+ *
13
+ * @param prop - property to locate
14
+ * @param obj - object to locate property in
15
+ */
16
+ export declare function exists(prop: string, obj: any): boolean;
17
+ /**
18
+ * deepMixin - combine several objects from right to left
19
+ * Usage: deepMixin({a: "a"}, {b: "b"});
20
+ *
21
+ * @param dest - target object to mix into.
22
+ * @param sources - objects to mix in
23
+ */
24
+ export declare function deepMixin(dest?: any, ...sources: any[]): any;
25
+ /**
26
+ * deepMixinT - combine several objects of Partial<T> from right to left
27
+ * Usage: deepMixinT<MyInterface>({a: "a"}, {b: "b"});
28
+ *
29
+ * Note: Only provided as a convenience, so user gets auto completion based on destination type.
30
+ *
31
+ * @param dest - target object to mix into.
32
+ * @param sources - objects to mix in
33
+ */
34
+ export declare function deepMixinT<T>(dest?: Partial<T>, ...sources: Array<Partial<T>>): T;
35
+ /**
36
+ * safeStingify - JSONsimilar to .stringify, except ignores circular references.
37
+ * Usage: safeStingify(object);
38
+ *
39
+ * @param obj - any object.
40
+ */
41
+ export declare function safeStringify(obj: object): string;
42
+ export declare function isArray(arg: any): arg is any[];
43
+ export interface ClassMeta {
44
+ module: string;
45
+ file: string;
46
+ class: string;
47
+ }
48
+ export declare function classID2Meta(classID: string): ClassMeta;
49
49
  //# sourceMappingURL=object.d.ts.map
@@ -1,19 +1,19 @@
1
- /**
2
- * IObserverHandle - Reference to an observing instance
3
- */
4
- export interface IObserverHandle {
5
- release(): void;
6
- unwatch(): void;
7
- }
8
- export declare type CallbackFunction = (...args: any[]) => void;
9
- export declare type EventID = string;
10
- export declare class Observable<T extends EventID> {
11
- private _eventObservers;
12
- constructor(...events: T[]);
13
- addObserver(eventID: T, callback: CallbackFunction): IObserverHandle;
14
- removeObserver(eventID: T, callback: CallbackFunction): this;
15
- dispatchEvent(eventID: T, ...args: any[]): this;
16
- private _hasObserver;
17
- hasObserver(_eventID?: T): boolean;
18
- }
1
+ /**
2
+ * IObserverHandle - Reference to an observing instance
3
+ */
4
+ export interface IObserverHandle {
5
+ release(): void;
6
+ unwatch(): void;
7
+ }
8
+ export declare type CallbackFunction = (...args: any[]) => void;
9
+ export declare type EventID = string;
10
+ export declare class Observable<T extends EventID> {
11
+ private _eventObservers;
12
+ constructor(...events: T[]);
13
+ addObserver(eventID: T, callback: CallbackFunction): IObserverHandle;
14
+ removeObserver(eventID: T, callback: CallbackFunction): this;
15
+ dispatchEvent(eventID: T, ...args: any[]): this;
16
+ private _hasObserver;
17
+ hasObserver(_eventID?: T): boolean;
18
+ }
19
19
  //# sourceMappingURL=observer.d.ts.map
@@ -1,6 +1,6 @@
1
- export declare const root: any;
2
- export declare const isBrowser: boolean;
3
- export declare const isNode: boolean;
4
- export declare const isCI: boolean;
5
- export declare function getScriptSrc(partial: string): string;
1
+ export declare const root: any;
2
+ export declare const isBrowser: boolean;
3
+ export declare const isNode: boolean;
4
+ export declare const isCI: boolean;
5
+ export declare function getScriptSrc(partial: string): string;
6
6
  //# sourceMappingURL=platform.d.ts.map
@@ -1,29 +1,29 @@
1
- import { StringAnyMap } from "./dictionary";
2
- import { Stack } from "./stack";
3
- export declare class XMLNode {
4
- name: string;
5
- $: StringAnyMap;
6
- protected _children: XMLNode[];
7
- content: string;
8
- constructor(name: string);
9
- appendAttribute(key: string, val: string): void;
10
- appendContent(content: string): void;
11
- appendChild(child: XMLNode): void;
12
- children(tag?: string): XMLNode[];
13
- }
14
- export declare class SAXStackParser {
15
- root: XMLNode;
16
- stack: Stack<XMLNode>;
17
- constructor();
18
- private walkDoc;
19
- private _startXMLNode;
20
- parse(xml: string): void;
21
- startDocument(): void;
22
- endDocument(): void;
23
- startXMLNode(node: XMLNode): void;
24
- endXMLNode(node: XMLNode): void;
25
- attributes(key: string, val: any): void;
26
- characters(text: string): void;
27
- }
28
- export declare function xml2json(xml: string): XMLNode;
1
+ import { StringAnyMap } from "./dictionary";
2
+ import { Stack } from "./stack";
3
+ export declare class XMLNode {
4
+ name: string;
5
+ $: StringAnyMap;
6
+ protected _children: XMLNode[];
7
+ content: string;
8
+ constructor(name: string);
9
+ appendAttribute(key: string, val: string): void;
10
+ appendContent(content: string): void;
11
+ appendChild(child: XMLNode): void;
12
+ children(tag?: string): XMLNode[];
13
+ }
14
+ export declare class SAXStackParser {
15
+ root: XMLNode;
16
+ stack: Stack<XMLNode>;
17
+ constructor();
18
+ private walkDoc;
19
+ private _startXMLNode;
20
+ parse(xml: string): void;
21
+ startDocument(): void;
22
+ endDocument(): void;
23
+ startXMLNode(node: XMLNode): void;
24
+ endXMLNode(node: XMLNode): void;
25
+ attributes(key: string, val: any): void;
26
+ characters(text: string): void;
27
+ }
28
+ export declare function xml2json(xml: string): XMLNode;
29
29
  //# sourceMappingURL=saxParser.d.ts.map
package/types/stack.d.ts CHANGED
@@ -1,29 +1,29 @@
1
- /**
2
- * A generic Stack
3
- */
4
- export declare class Stack<T> {
5
- private stack;
6
- /**
7
- * Push element onto the stack
8
- *
9
- * @param e - element to push
10
- */
11
- push(e: T): T;
12
- /**
13
- * Pop element off the stack
14
- */
15
- pop(): T | undefined;
16
- /**
17
- * Top item on the stack
18
- *
19
- * @returns Top element on the stack
20
- */
21
- top(): T | undefined;
22
- /**
23
- * Depth of stack
24
- *
25
- * @returns Depth
26
- */
27
- depth(): number;
28
- }
1
+ /**
2
+ * A generic Stack
3
+ */
4
+ export declare class Stack<T> {
5
+ private stack;
6
+ /**
7
+ * Push element onto the stack
8
+ *
9
+ * @param e - element to push
10
+ */
11
+ push(e: T): T;
12
+ /**
13
+ * Pop element off the stack
14
+ */
15
+ pop(): T | undefined;
16
+ /**
17
+ * Top item on the stack
18
+ *
19
+ * @returns Top element on the stack
20
+ */
21
+ top(): T | undefined;
22
+ /**
23
+ * Depth of stack
24
+ *
25
+ * @returns Depth
26
+ */
27
+ depth(): number;
28
+ }
29
29
  //# sourceMappingURL=stack.d.ts.map
@@ -1,34 +1,34 @@
1
- import { IObserverHandle } from "./dispatch";
2
- export interface IEvent {
3
- id: string;
4
- oldValue: any;
5
- newValue: any;
6
- }
7
- export declare type StatePropCallback = (changes: IEvent) => void;
8
- export declare type StateCallback = (changes: IEvent[]) => void;
9
- export declare type StateEvents = "propChanged" | "changed";
10
- export declare class StateObject<U, I> {
11
- private _espState;
12
- private _dispatch;
13
- private _monitorHandle?;
14
- protected _monitorTickCount: number;
15
- protected clear(newVals?: Partial<I>): void;
16
- protected get(): U;
17
- protected get<K extends keyof U>(key: K, defValue?: U[K]): U[K];
18
- protected set(newVals: I): void;
19
- protected set<K extends keyof U>(key: K, newVal: U[K], batchMode?: boolean): void;
20
- private setSingle;
21
- private setAll;
22
- protected has<K extends keyof U>(key: K): boolean;
23
- addObserver(eventID: StateEvents, callback: StateCallback): IObserverHandle;
24
- addObserver(eventID: StateEvents, propID: keyof U, callback: StatePropCallback): IObserverHandle;
25
- on(eventID: StateEvents, callback: StateCallback): this;
26
- on(eventID: StateEvents, propID: keyof U, callback: StatePropCallback): this;
27
- protected isCallback(propIDOrCallback: StateCallback | keyof U): propIDOrCallback is StateCallback;
28
- protected hasEventListener(): boolean;
29
- protected refresh(full?: boolean): Promise<this>;
30
- protected _monitor(): void;
31
- protected _monitorTimeoutDuraction(): number;
32
- watch(callback: StateCallback, triggerChange?: boolean): IObserverHandle;
33
- }
1
+ import { IObserverHandle } from "./dispatch";
2
+ export interface IEvent {
3
+ id: string;
4
+ oldValue: any;
5
+ newValue: any;
6
+ }
7
+ export declare type StatePropCallback = (changes: IEvent) => void;
8
+ export declare type StateCallback = (changes: IEvent[]) => void;
9
+ export declare type StateEvents = "propChanged" | "changed";
10
+ export declare class StateObject<U, I> {
11
+ private _espState;
12
+ private _dispatch;
13
+ private _monitorHandle?;
14
+ protected _monitorTickCount: number;
15
+ protected clear(newVals?: Partial<I>): void;
16
+ protected get(): U;
17
+ protected get<K extends keyof U>(key: K, defValue?: U[K]): U[K];
18
+ protected set(newVals: I): void;
19
+ protected set<K extends keyof U>(key: K, newVal: U[K], batchMode?: boolean): void;
20
+ private setSingle;
21
+ private setAll;
22
+ protected has<K extends keyof U>(key: K): boolean;
23
+ addObserver(eventID: StateEvents, callback: StateCallback): IObserverHandle;
24
+ addObserver(eventID: StateEvents, propID: keyof U, callback: StatePropCallback): IObserverHandle;
25
+ on(eventID: StateEvents, callback: StateCallback): this;
26
+ on(eventID: StateEvents, propID: keyof U, callback: StatePropCallback): this;
27
+ protected isCallback(propIDOrCallback: StateCallback | keyof U): propIDOrCallback is StateCallback;
28
+ protected hasEventListener(): boolean;
29
+ protected refresh(full?: boolean): Promise<this>;
30
+ protected _monitor(): void;
31
+ protected _monitorTimeoutDuraction(): number;
32
+ watch(callback: StateCallback, triggerChange?: boolean): IObserverHandle;
33
+ }
34
34
  //# sourceMappingURL=stateful.d.ts.map
package/types/string.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare function trim(str: string, char: string): string;
2
- export declare function endsWith(origString: string, searchString: string, position?: number): boolean;
1
+ export declare function trim(str: string, char: string): string;
2
+ export declare function endsWith(origString: string, searchString: string, position?: number): boolean;
3
3
  //# sourceMappingURL=string.d.ts.map
package/types/url.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare function join(...segments: string[]): string;
2
- export declare function dirname(path: string): string;
1
+ export declare function join(...segments: string[]): string;
2
+ export declare function dirname(path: string): string;
3
3
  //# sourceMappingURL=url.d.ts.map
@@ -1,4 +1,4 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/util";
2
- export declare const PKG_VERSION = "2.42.0";
3
- export declare const BUILD_VERSION = "2.97.0";
2
+ export declare const PKG_VERSION = "2.46.1";
3
+ export declare const BUILD_VERSION = "2.102.1";
4
4
  //# sourceMappingURL=__package__.d.ts.map