@hpcc-js/util 2.52.0 → 3.1.0

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 (126) hide show
  1. package/dist/index.js +1 -2590
  2. package/dist/index.js.map +7 -1
  3. package/package.json +27 -31
  4. package/src/__package__.ts +2 -2
  5. package/src/array.ts +1 -2
  6. package/src/cache.ts +1 -1
  7. package/src/debounce.ts +4 -4
  8. package/src/dispatch.ts +5 -5
  9. package/src/graph2.ts +1 -1
  10. package/src/index.ts +21 -21
  11. package/src/logging.ts +2 -2
  12. package/src/saxParser.ts +4 -4
  13. package/src/stateful.ts +4 -4
  14. package/src/url.ts +1 -1
  15. package/types/__package__.d.ts +2 -3
  16. package/types/array.d.ts +0 -1
  17. package/types/cache.d.ts +0 -1
  18. package/types/debounce.d.ts +0 -1
  19. package/types/dictionary.d.ts +0 -1
  20. package/types/dispatch.d.ts +1 -2
  21. package/types/esp.d.ts +0 -1
  22. package/types/graph.d.ts +0 -1
  23. package/types/graph2.d.ts +0 -1
  24. package/types/hashSum.d.ts +0 -1
  25. package/types/immutable.d.ts +0 -1
  26. package/types/index.d.ts +21 -22
  27. package/types/logging.d.ts +0 -1
  28. package/types/math.d.ts +0 -1
  29. package/types/object.d.ts +0 -1
  30. package/types/observer.d.ts +0 -1
  31. package/types/platform.d.ts +0 -1
  32. package/types/saxParser.d.ts +4 -5
  33. package/types/stack.d.ts +0 -1
  34. package/types/stateful.d.ts +1 -2
  35. package/types/string.d.ts +0 -1
  36. package/types/url.d.ts +0 -1
  37. package/dist/index.min.js +0 -2
  38. package/dist/index.min.js.map +0 -1
  39. package/lib-es6/__package__.js +0 -4
  40. package/lib-es6/__package__.js.map +0 -1
  41. package/lib-es6/array.js +0 -85
  42. package/lib-es6/array.js.map +0 -1
  43. package/lib-es6/cache.js +0 -61
  44. package/lib-es6/cache.js.map +0 -1
  45. package/lib-es6/debounce.js +0 -86
  46. package/lib-es6/debounce.js.map +0 -1
  47. package/lib-es6/dictionary.js +0 -62
  48. package/lib-es6/dictionary.js.map +0 -1
  49. package/lib-es6/dispatch.js +0 -102
  50. package/lib-es6/dispatch.js.map +0 -1
  51. package/lib-es6/esp.js +0 -33
  52. package/lib-es6/esp.js.map +0 -1
  53. package/lib-es6/graph.js +0 -349
  54. package/lib-es6/graph.js.map +0 -1
  55. package/lib-es6/graph2.js +0 -619
  56. package/lib-es6/graph2.js.map +0 -1
  57. package/lib-es6/hashSum.js +0 -50
  58. package/lib-es6/hashSum.js.map +0 -1
  59. package/lib-es6/immutable.js +0 -148
  60. package/lib-es6/immutable.js.map +0 -1
  61. package/lib-es6/index.js +0 -22
  62. package/lib-es6/index.js.map +0 -1
  63. package/lib-es6/logging.js +0 -179
  64. package/lib-es6/logging.js.map +0 -1
  65. package/lib-es6/math.js +0 -91
  66. package/lib-es6/math.js.map +0 -1
  67. package/lib-es6/object.js +0 -122
  68. package/lib-es6/object.js.map +0 -1
  69. package/lib-es6/observer.js +0 -80
  70. package/lib-es6/observer.js.map +0 -1
  71. package/lib-es6/platform.js +0 -18
  72. package/lib-es6/platform.js.map +0 -1
  73. package/lib-es6/saxParser.js +0 -126
  74. package/lib-es6/saxParser.js.map +0 -1
  75. package/lib-es6/stack.js +0 -42
  76. package/lib-es6/stack.js.map +0 -1
  77. package/lib-es6/stateful.js +0 -171
  78. package/lib-es6/stateful.js.map +0 -1
  79. package/lib-es6/string.js +0 -23
  80. package/lib-es6/string.js.map +0 -1
  81. package/lib-es6/url.js +0 -33
  82. package/lib-es6/url.js.map +0 -1
  83. package/types/__package__.d.ts.map +0 -1
  84. package/types/array.d.ts.map +0 -1
  85. package/types/cache.d.ts.map +0 -1
  86. package/types/debounce.d.ts.map +0 -1
  87. package/types/dictionary.d.ts.map +0 -1
  88. package/types/dispatch.d.ts.map +0 -1
  89. package/types/esp.d.ts.map +0 -1
  90. package/types/graph.d.ts.map +0 -1
  91. package/types/graph2.d.ts.map +0 -1
  92. package/types/hashSum.d.ts.map +0 -1
  93. package/types/immutable.d.ts.map +0 -1
  94. package/types/index.d.ts.map +0 -1
  95. package/types/logging.d.ts.map +0 -1
  96. package/types/math.d.ts.map +0 -1
  97. package/types/object.d.ts.map +0 -1
  98. package/types/observer.d.ts.map +0 -1
  99. package/types/platform.d.ts.map +0 -1
  100. package/types/saxParser.d.ts.map +0 -1
  101. package/types/stack.d.ts.map +0 -1
  102. package/types/stateful.d.ts.map +0 -1
  103. package/types/string.d.ts.map +0 -1
  104. package/types/url.d.ts.map +0 -1
  105. package/types-3.4/__package__.d.ts +0 -4
  106. package/types-3.4/array.d.ts +0 -14
  107. package/types-3.4/cache.d.ts +0 -21
  108. package/types-3.4/debounce.d.ts +0 -13
  109. package/types-3.4/dictionary.d.ts +0 -21
  110. package/types-3.4/dispatch.d.ts +0 -27
  111. package/types-3.4/esp.d.ts +0 -2
  112. package/types-3.4/graph.d.ts +0 -74
  113. package/types-3.4/graph2.d.ts +0 -112
  114. package/types-3.4/hashSum.d.ts +0 -2
  115. package/types-3.4/immutable.d.ts +0 -4
  116. package/types-3.4/index.d.ts +0 -22
  117. package/types-3.4/logging.d.ts +0 -58
  118. package/types-3.4/math.d.ts +0 -71
  119. package/types-3.4/object.d.ts +0 -52
  120. package/types-3.4/observer.d.ts +0 -19
  121. package/types-3.4/platform.d.ts +0 -6
  122. package/types-3.4/saxParser.d.ts +0 -29
  123. package/types-3.4/stack.d.ts +0 -29
  124. package/types-3.4/stateful.d.ts +0 -34
  125. package/types-3.4/string.d.ts +0 -3
  126. package/types-3.4/url.d.ts +0 -3
package/package.json CHANGED
@@ -1,48 +1,44 @@
1
1
  {
2
2
  "name": "@hpcc-js/util",
3
- "version": "2.52.0",
3
+ "version": "3.1.0",
4
4
  "description": "hpcc-js - Utilities",
5
- "main": "dist/index.js",
6
- "module": "lib-es6/index",
7
- "unpkg": "dist/index.min.js",
8
- "jsdelivr": "dist/index.min.js",
9
- "types": "types/index.d.ts",
10
- "typesVersions": {
11
- "<3.8": {
12
- "*": [
13
- "types-3.4/index.d.ts"
14
- ]
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./types/index.d.ts",
9
+ "default": "./dist/index.js"
15
10
  }
16
11
  },
12
+ "main": "./dist/index.js",
13
+ "types": "./types/index.d.ts",
17
14
  "files": [
18
- "types/*",
19
- "types-3.4/*",
20
- "lib-es6/*",
15
+ "dist/*",
21
16
  "src/*",
22
- "dist/*"
17
+ "types/*"
23
18
  ],
24
19
  "scripts": {
25
- "clean": "rimraf --glob lib* types dist *.tsbuildinfo",
26
- "compile-es6": "tsc --module es6 --outDir ./lib-es6",
27
- "compile-es6-watch": "npm run compile-es6 -- -w",
28
- "compile-umd": "tsc --module umd --outDir ./lib-umd",
29
- "compile-umd-watch": "npm run compile-umd -- -w",
30
- "bundle": "rollup -c",
31
- "bundle-watch": "npm run bundle -- -w",
32
- "minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
33
- "gen-legacy-types": "downlevel-dts ./types ./types-3.4",
34
- "build": "npm run compile-es6 && npm run bundle",
35
- "watch": "npm-run-all compile-es6 -p compile-es6-watch bundle-watch",
20
+ "clean": "rimraf --glob lib* types dist dist-test *.tsbuildinfo .turbo",
21
+ "bundle": "node esbuild.js",
22
+ "bundle-watch": "npm run bundle -- --development --watch",
23
+ "gen-types": "tsc --project tsconfig.json",
24
+ "gen-types-watch": "npm run gen-types -- --watch",
25
+ "build": "run-p gen-types bundle",
36
26
  "stamp": "node ../../node_modules/@hpcc-js/bundle/src/stamp.js",
37
27
  "lint": "eslint ./src",
38
28
  "docs": "typedoc --options tdoptions.json .",
39
- "update": "npx --yes npm-check-updates -u -t minor"
29
+ "test-browser": "vitest run --project browser",
30
+ "test-node": "vitest run --project node",
31
+ "test": "vitest run",
32
+ "coverage": "vitest run --coverage",
33
+ "update": "npx -y npm-check-updates -u -t minor",
34
+ "update-major": "npx -y npm-check-updates -u"
40
35
  },
41
36
  "dependencies": {
42
- "tslib": "2.6.3"
37
+ "@xmldom/xmldom": "0.9.4"
43
38
  },
44
39
  "devDependencies": {
45
- "@hpcc-js/bundle": "^2.12.0"
40
+ "@hpcc-js/bundle": "^2.12.0",
41
+ "@hpcc-js/esbuild-plugins": "^1.2.0"
46
42
  },
47
43
  "repository": {
48
44
  "type": "git",
@@ -54,6 +50,6 @@
54
50
  "bugs": {
55
51
  "url": "https://github.com/hpcc-systems/Visualization/issues"
56
52
  },
57
- "homepage": "https://github.com/hpcc-systems/Visualization",
58
- "gitHead": "99332f074dd1fff0cbb8eae52c5b6c98d6ad5a7a"
53
+ "homepage": "https://github.com/hpcc-systems/Visualization/tree/trunk/packages/util",
54
+ "gitHead": "3f6146539f487dca08a35cdd5f94ca29609b4343"
59
55
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/util";
2
- export const PKG_VERSION = "2.52.0";
3
- export const BUILD_VERSION = "2.106.0";
2
+ export const PKG_VERSION = "3.1.0";
3
+ export const BUILD_VERSION = "2.107.0";
package/src/array.ts CHANGED
@@ -26,7 +26,7 @@ export function find<T>(o: ReadonlyArray<T>, predicate: (value: T, index: number
26
26
  // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
27
27
  // d. If testResult is true, return kValue.
28
28
  const kValue = o[k];
29
- if (predicate.call(thisArg, kValue, k, o)) {
29
+ if (predicate.call(thisArg, kValue, k)) {
30
30
  return kValue;
31
31
  }
32
32
  // e. Increase k by 1.
@@ -36,7 +36,6 @@ export function find<T>(o: ReadonlyArray<T>, predicate: (value: T, index: number
36
36
  // 7. Return undefined.
37
37
  return undefined;
38
38
  }
39
-
40
39
  export interface IDifferences2<T> {
41
40
  update: T[];
42
41
  exit: T[];
package/src/cache.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { hashSum } from "./hashSum";
1
+ import { hashSum } from "./hashSum.ts";
2
2
 
3
3
  export class Cache<I, C> {
4
4
  private _cache: { [id: string]: C } = {};
package/src/debounce.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { hashSum } from "./hashSum";
1
+ import { hashSum } from "./hashSum.ts";
2
2
 
3
3
  export function debounce<R extends Promise<any>>(fn: () => R, timeout?: number): () => R;
4
4
  export function debounce<P1, R extends Promise<any>>(fn: (param1: P1) => R, timeout?: number): (param1: P1) => R;
@@ -33,7 +33,7 @@ export function debounce<TParam, R extends Promise<any>>(fn: (...params: TParam[
33
33
  }
34
34
 
35
35
  export function promiseTimeout<T>(ms: number, promise: Promise<T>): Promise<T> {
36
- let id: number;
36
+ let id: any;
37
37
  const timeout = new Promise((resolve, reject) => {
38
38
  id = setTimeout(() => {
39
39
  clearTimeout(id);
@@ -44,9 +44,9 @@ export function promiseTimeout<T>(ms: number, promise: Promise<T>): Promise<T> {
44
44
  return Promise.race([
45
45
  promise,
46
46
  timeout
47
- ]).then((response: T) => {
47
+ ]).then((response: unknown) => {
48
48
  clearTimeout(id);
49
- return response;
49
+ return response as T;
50
50
  }).catch(e => {
51
51
  clearTimeout(id);
52
52
  throw e;
package/src/dispatch.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { IObserverHandle } from "./observer";
2
- import { root } from "./platform";
1
+ import type { IObserverHandle } from "./observer.ts";
2
+ import { root } from "./platform.ts";
3
3
 
4
4
  export type RquestAnimationFrame = (callback: FrameRequestCallback) => number | undefined;
5
5
  export type CancelAnimationFrame = (handle: number) => void | undefined;
@@ -13,7 +13,7 @@ let requestAnimationFrame: RquestAnimationFrame;
13
13
  // cancelAnimationFrame = root.cancelAnimationFrame;
14
14
  } else {
15
15
  let lastTime = 0;
16
- requestAnimationFrame = function (callback: FrameRequestCallback): number {
16
+ requestAnimationFrame = function (callback: FrameRequestCallback): any {
17
17
  const currTime = new Date().getTime();
18
18
  const timeToCall = Math.max(0, 16 - (currTime - lastTime));
19
19
  const id = setTimeout(() => callback(currTime + timeToCall), timeToCall);
@@ -51,13 +51,13 @@ type ObserverAdapter<T extends Message = Message> = {
51
51
  export class Dispatch<T extends Message = Message> {
52
52
 
53
53
  private _observerID: number = 0;
54
- private _observers: ObserverAdapter[] = [];
54
+ private _observers: ObserverAdapter<T>[] = [];
55
55
  private _messageBuffer: T[] = [];
56
56
 
57
57
  constructor() {
58
58
  }
59
59
 
60
- private observers(): ObserverAdapter[] {
60
+ private observers(): ObserverAdapter<T>[] {
61
61
  return this._observers;
62
62
  }
63
63
 
package/src/graph2.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { compare2 } from "./array";
1
+ import { compare2 } from "./array.ts";
2
2
 
3
3
  type ID = string | number;
4
4
 
package/src/index.ts CHANGED
@@ -1,21 +1,21 @@
1
- export * from "./__package__";
2
- export * from "./array";
3
- export * from "./cache";
4
- export * from "./debounce";
5
- export * from "./dictionary";
6
- export * from "./esp";
7
- export * from "./graph";
8
- export * from "./graph2";
9
- export * from "./hashSum";
10
- export * from "./immutable";
11
- export * from "./logging";
12
- export * from "./math";
13
- export * from "./object";
14
- export * from "./observer";
15
- export * from "./dispatch";
16
- export * from "./platform";
17
- export * from "./saxParser";
18
- export * from "./stack";
19
- export * from "./stateful";
20
- export * from "./string";
21
- export * from "./url";
1
+ export * from "./__package__.ts";
2
+ export * from "./array.ts";
3
+ export * from "./cache.ts";
4
+ export * from "./debounce.ts";
5
+ export * from "./dictionary.ts";
6
+ export * from "./esp.ts";
7
+ export * from "./graph.ts";
8
+ export * from "./graph2.ts";
9
+ export * from "./hashSum.ts";
10
+ export * from "./immutable.ts";
11
+ export * from "./logging.ts";
12
+ export * from "./math.ts";
13
+ export * from "./object.ts";
14
+ export * from "./observer.ts";
15
+ export * from "./dispatch.ts";
16
+ export * from "./platform.ts";
17
+ export * from "./saxParser.ts";
18
+ export * from "./stack.ts";
19
+ export * from "./stateful.ts";
20
+ export * from "./string.ts";
21
+ export * from "./url.ts";
package/src/logging.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-console */
2
- import { isNode } from "./platform";
3
- import { Stack } from "./stack";
2
+ import { isNode } from "./platform.ts";
3
+ import { Stack } from "./stack.ts";
4
4
 
5
5
  export enum Level {
6
6
  debug,
package/src/saxParser.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { StringAnyMap } from "./dictionary";
2
- import { Stack } from "./stack";
1
+ import { StringAnyMap } from "./dictionary.ts";
2
+ import { Stack } from "./stack.ts";
3
3
 
4
4
  export class XMLNode {
5
5
  name: string = "";
@@ -34,7 +34,7 @@ export class XMLNode {
34
34
  }
35
35
 
36
36
  export class SAXStackParser {
37
- root: XMLNode;
37
+ root?: XMLNode;
38
38
  stack: Stack<XMLNode> = new Stack<XMLNode>();
39
39
 
40
40
  constructor() {
@@ -128,7 +128,7 @@ class XML2JSONParser extends SAXStackParser {
128
128
  }
129
129
  }
130
130
 
131
- export function xml2json(xml: string): XMLNode {
131
+ export function xml2json(xml: string): XMLNode | undefined {
132
132
  const saxParser = new XML2JSONParser();
133
133
  saxParser.parse(xml);
134
134
  return saxParser.root;
package/src/stateful.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Dispatch, IObserverHandle, Message } from "./dispatch";
2
- import { deepEquals } from "./immutable";
1
+ import { Dispatch, IObserverHandle, Message } from "./dispatch.ts";
2
+ import { deepEquals } from "./immutable.ts";
3
3
 
4
4
  class PropChangedMessage extends Message {
5
5
 
@@ -32,8 +32,8 @@ export type StateCallback = (changes: IEvent[]) => void;
32
32
  export type StateEvents = "propChanged" | "changed";
33
33
  export class StateObject<U, I> {
34
34
  private _espState: Partial<U> = {} as U;
35
- private _dispatch = new Dispatch();
36
- private _monitorHandle?: number;
35
+ private _dispatch = new Dispatch<PropChangedMessage>();
36
+ private _monitorHandle?: any;
37
37
  protected _monitorTickCount: number = 0;
38
38
 
39
39
  protected clear(newVals?: Partial<I>) {
package/src/url.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export function join(...segments: string[]) {
2
- const parts: string[] = segments.reduce((parts, segment) => {
2
+ const parts: string[] = segments.reduce((parts: string[], segment) => {
3
3
  // Remove leading slashes from non-first part.
4
4
  if (parts.length > 0) {
5
5
  segment = segment.replace(/^\//, "");
@@ -1,4 +1,3 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/util";
2
- export declare const PKG_VERSION = "2.52.0";
3
- export declare const BUILD_VERSION = "2.106.0";
4
- //# sourceMappingURL=__package__.d.ts.map
2
+ export declare const PKG_VERSION = "3.1.0";
3
+ export declare const BUILD_VERSION = "2.107.0";
package/types/array.d.ts CHANGED
@@ -11,4 +11,3 @@ export interface IDifferences2<T> {
11
11
  exit: T[];
12
12
  }
13
13
  export declare function compare2<T>(before: readonly T[], after: readonly T[], idFunc: (itme: T) => string | number, updateFunc?: (before: T, after: T) => T): IDifferences2<T>;
14
- //# sourceMappingURL=array.d.ts.map
package/types/cache.d.ts CHANGED
@@ -18,4 +18,3 @@ export declare class AsyncCache<I, C> {
18
18
  get(espObj: I): Promise<C | null>;
19
19
  get(espObj: I, factory: () => Promise<C>): Promise<C>;
20
20
  }
21
- //# sourceMappingURL=cache.d.ts.map
@@ -10,4 +10,3 @@ export declare class AsyncOrderedQueue {
10
10
  push<T>(p: Promise<T>): Promise<T>;
11
11
  }
12
12
  export declare function sleep(ms: number): Promise<void>;
13
- //# sourceMappingURL=debounce.d.ts.map
@@ -18,4 +18,3 @@ export declare class DictionaryNoCase<T> extends Dictionary<T> {
18
18
  has(key: string): boolean;
19
19
  remove(key: string): void;
20
20
  }
21
- //# sourceMappingURL=dictionary.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { IObserverHandle } from "./observer";
1
+ import type { IObserverHandle } from "./observer.ts";
2
2
  export type RquestAnimationFrame = (callback: FrameRequestCallback) => number | undefined;
3
3
  export type CancelAnimationFrame = (handle: number) => void | undefined;
4
4
  export declare class Message {
@@ -24,4 +24,3 @@ export declare class Dispatch<T extends Message = Message> {
24
24
  post(msg: T): void;
25
25
  attach(callback: Callback<T>, type?: MessageConstructor<T>): IObserverHandle;
26
26
  }
27
- //# sourceMappingURL=dispatch.d.ts.map
package/types/esp.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export declare function espTime2Seconds(duration: string): number;
2
- //# sourceMappingURL=esp.d.ts.map
package/types/graph.d.ts CHANGED
@@ -71,4 +71,3 @@ export declare class Graph<S = undefined, V = undefined, E = undefined> {
71
71
  walk(visitor: (visitor: GraphItem<S, V, E>) => "abort" | "stepover" | void): true | undefined;
72
72
  clone(): Graph<S, V, E>;
73
73
  }
74
- //# sourceMappingURL=graph.d.ts.map
package/types/graph2.d.ts CHANGED
@@ -109,4 +109,3 @@ export declare class Graph2<V = any, E = any, S = any> {
109
109
  sort(v_id?: string): V[];
110
110
  }
111
111
  export {};
112
- //# sourceMappingURL=graph2.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function hashSum(o: any): string;
2
- //# sourceMappingURL=hashSum.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare function verboseDeepEquals(a: any, b: any, functionRefCompare?: boolean): boolean;
2
2
  export declare function deepEquals(a: any, b: any, functionRefCompare?: boolean): boolean;
3
3
  export declare function update<T>(origItem: T, newItem: T, functionRefCompare?: boolean): T;
4
- //# sourceMappingURL=immutable.d.ts.map
package/types/index.d.ts CHANGED
@@ -1,22 +1,21 @@
1
- export * from "./__package__";
2
- export * from "./array";
3
- export * from "./cache";
4
- export * from "./debounce";
5
- export * from "./dictionary";
6
- export * from "./esp";
7
- export * from "./graph";
8
- export * from "./graph2";
9
- export * from "./hashSum";
10
- export * from "./immutable";
11
- export * from "./logging";
12
- export * from "./math";
13
- export * from "./object";
14
- export * from "./observer";
15
- export * from "./dispatch";
16
- export * from "./platform";
17
- export * from "./saxParser";
18
- export * from "./stack";
19
- export * from "./stateful";
20
- export * from "./string";
21
- export * from "./url";
22
- //# sourceMappingURL=index.d.ts.map
1
+ export * from "./__package__.ts";
2
+ export * from "./array.ts";
3
+ export * from "./cache.ts";
4
+ export * from "./debounce.ts";
5
+ export * from "./dictionary.ts";
6
+ export * from "./esp.ts";
7
+ export * from "./graph.ts";
8
+ export * from "./graph2.ts";
9
+ export * from "./hashSum.ts";
10
+ export * from "./immutable.ts";
11
+ export * from "./logging.ts";
12
+ export * from "./math.ts";
13
+ export * from "./object.ts";
14
+ export * from "./observer.ts";
15
+ export * from "./dispatch.ts";
16
+ export * from "./platform.ts";
17
+ export * from "./saxParser.ts";
18
+ export * from "./stack.ts";
19
+ export * from "./stateful.ts";
20
+ export * from "./string.ts";
21
+ export * from "./url.ts";
@@ -55,4 +55,3 @@ export declare class ScopedLogging {
55
55
  popLevel(): this;
56
56
  }
57
57
  export declare function scopedLogger(scopeID: string, filter?: boolean): ScopedLogging;
58
- //# sourceMappingURL=logging.d.ts.map
package/types/math.d.ts CHANGED
@@ -68,4 +68,3 @@ export declare function normalizeDegrees(degrees: number, min?: number, max?: nu
68
68
  * @returns Number normalized to within the provided range
69
69
  */
70
70
  export declare function normalize(value: number, min: number, max: number): number;
71
- //# sourceMappingURL=math.d.ts.map
package/types/object.d.ts CHANGED
@@ -49,4 +49,3 @@ export interface ClassMeta {
49
49
  class: string;
50
50
  }
51
51
  export declare function classID2Meta(classID: string): ClassMeta;
52
- //# sourceMappingURL=object.d.ts.map
@@ -16,4 +16,3 @@ export declare class Observable<T extends EventID> {
16
16
  private _hasObserver;
17
17
  hasObserver(_eventID?: T): boolean;
18
18
  }
19
- //# sourceMappingURL=observer.d.ts.map
@@ -3,4 +3,3 @@ export declare const isBrowser: boolean;
3
3
  export declare const isNode: boolean;
4
4
  export declare const isCI: boolean;
5
5
  export declare function getScriptSrc(partial: string): string;
6
- //# sourceMappingURL=platform.d.ts.map
@@ -1,5 +1,5 @@
1
- import { StringAnyMap } from "./dictionary";
2
- import { Stack } from "./stack";
1
+ import { StringAnyMap } from "./dictionary.ts";
2
+ import { Stack } from "./stack.ts";
3
3
  export declare class XMLNode {
4
4
  name: string;
5
5
  $: StringAnyMap;
@@ -12,7 +12,7 @@ export declare class XMLNode {
12
12
  children(tag?: string): XMLNode[];
13
13
  }
14
14
  export declare class SAXStackParser {
15
- root: XMLNode;
15
+ root?: XMLNode;
16
16
  stack: Stack<XMLNode>;
17
17
  constructor();
18
18
  private walkDoc;
@@ -25,5 +25,4 @@ export declare class SAXStackParser {
25
25
  attributes(key: string, val: any): void;
26
26
  characters(text: string): void;
27
27
  }
28
- export declare function xml2json(xml: string): XMLNode;
29
- //# sourceMappingURL=saxParser.d.ts.map
28
+ export declare function xml2json(xml: string): XMLNode | undefined;
package/types/stack.d.ts CHANGED
@@ -26,4 +26,3 @@ export declare class Stack<T> {
26
26
  */
27
27
  depth(): number;
28
28
  }
29
- //# sourceMappingURL=stack.d.ts.map
@@ -1,4 +1,4 @@
1
- import { IObserverHandle } from "./dispatch";
1
+ import { IObserverHandle } from "./dispatch.ts";
2
2
  export interface IEvent {
3
3
  id: string;
4
4
  oldValue: any;
@@ -31,4 +31,3 @@ export declare class StateObject<U, I> {
31
31
  protected _monitorTimeoutDuration(): number;
32
32
  watch(callback: StateCallback, triggerChange?: boolean): IObserverHandle;
33
33
  }
34
- //# sourceMappingURL=stateful.d.ts.map
package/types/string.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export declare function trim(str: string, char: string): string;
2
2
  export declare function endsWith(origString: string, searchString: string, position?: number): boolean;
3
- //# sourceMappingURL=string.d.ts.map
package/types/url.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export declare function join(...segments: string[]): string;
2
2
  export declare function dirname(path: string): string;
3
- //# sourceMappingURL=url.d.ts.map
package/dist/index.min.js DELETED
@@ -1,2 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/util"]={})}(this,(function(t){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)};function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)};function o(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))}function i(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(a){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function s(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function u(t,e,r,n){void 0===n&&(n=function(t,e){return e});var o={update:[],exit:[],enter:[]};if(t===e)return o.update=t,o;var i={};e.forEach((function(t){i[r(t)]=t}));for(var s=0,u=t;s<u.length;s++){var a=u[s],c=r(a),p=i[c];void 0!==p?(delete i[c],o.update.push(n(a,p))):o.exit.push(a)}for(var h in i)o.enter.push(i[h]);return o}function a(t,e){if(0===e.length)return t;for(var r=0;r<e.length;++r){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t<0?-2*t:t}function c(t,e,r,n){var o,i=a(a(a(t,r),(o=e,Object.prototype.toString.call(o))),typeof e);return null===e?a(i,"null"):void 0===e?a(i,"undefined"):"object"==typeof e?-1!==n.indexOf(e)?a(i,"[Circular]"+r):(n.push(e),function(t,e,r){return"function"==typeof e.hashSum?e.hashSum():Object.keys(e).sort().reduce((function(t,n){return c(t,e[n],n,r)}),t)}(i,e,n)):a(i,e.toString())}function p(t){return function(t,e){for(;t.length<e;)t="0"+t;return t}(c(0,t,"",[]).toString(16),8)}"function"==typeof SuppressedError&&SuppressedError;var h=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return p(n({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t){return this._cache[this._calcID(t)]=t,t},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(e()):null)},t}(),f=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return p(n({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t,e){return this._cache[this._calcID(t)]=e,e},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(t,e()):Promise.resolve(null))},t}();var l=function(){function t(){this._q=[]}return t.prototype.isTop=function(t){return this._q[0]===t},t.prototype.push=function(t){var e=this,r=t.then((function(t){return e.isTop(r)?(e._q.shift(),t):new Promise((function(n,o){var i=setInterval((function(){e.isTop(r)&&(clearInterval(i),e._q.shift(),n(t))}),20)}))}));return this._q.push(r),r},t}();var d=function(){function t(t){if(this.store={},t)for(var e in t)this.set(e,t[e])}return t.prototype.set=function(t,e){var r=this.store[t];return this.store[t]=e,r},t.prototype.get=function(t){return this.store[t]},t.prototype.has=function(t){return void 0!==this.store[t]},t.prototype.remove=function(t){delete this.store[t]},t.prototype.keys=function(){var t=[];for(var e in this.store)t.push(e);return t},t.prototype.values=function(){var t=[];for(var e in this.store)t.push(this.store[e]);return t},t}(),g=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.set=function(e,r){return t.prototype.set.call(this,e.toLowerCase(),r)},e.prototype.get=function(e){return t.prototype.get.call(this,e.toLowerCase())},e.prototype.has=function(e){return t.prototype.has.call(this,e.toLowerCase())},e.prototype.remove=function(e){return t.prototype.remove.call(this,e.toLowerCase())},e}(d);var v=function(t,e){this.props={},this._graph=t,this.parent=e},_=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.subgraphs=[],o.vertices=[],o.edges=[],r&&r._addSubgraph(o),o._=n,o}return r(e,t),e.prototype.remove=function(t){void 0===t&&(t=!0),this._graph.removeSubgraph(this,t)},e.prototype.createSubgraph=function(t){return this._graph.createSubgraph(this,t)},e.prototype._addSubgraph=function(t){if(this.subgraphs.indexOf(t)>=0)throw new Error("Subgraph already exists");this.subgraphs.push(t)},e.prototype._removeSubgraph=function(t){var e=this.subgraphs.indexOf(t);if(e<0)throw new Error("Subgraph does not exist");this.subgraphs.splice(e,1)},e.prototype.removeAllSubgraphs=function(){for(var t=this.subgraphs.length-1;t>=0;--t)this._graph.removeSubgraph(this.subgraphs[t],!0)},e.prototype.createVertex=function(t){return this._graph.createVertex(this,t)},e.prototype._addVertex=function(t){if(this.vertices.indexOf(t)>=0)throw new Error("Vertex already exists");this.vertices.push(t)},e.prototype._removeVertex=function(t){var e=this.vertices.indexOf(t);if(e<0)throw new Error("Vertex does not exist");this.vertices.splice(e,1)},e.prototype.removeAllVertices=function(){for(var t=this.vertices.length-1;t>=0;--t)this._graph.removeVertex(this.vertices[t],!0)},e.prototype.createEdge=function(t,e,r){return this._graph.createEdge(this,t,e,r)},e.prototype._addEdge=function(t){if(this.edges.indexOf(t)>=0)throw new Error("Edge already exists");this.edges.push(t)},e.prototype._removeEdge=function(t){var e=this.edges.indexOf(t);if(e<0)throw new Error("Edge does not exist");this.edges.splice(e,1)},e.prototype._add=function(t){t instanceof e?this._addSubgraph(t):t instanceof y?this._addVertex(t):this._addEdge(t)},e}(v),y=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.inEdges=[],o.outEdges=[],r._addVertex(o),o._=n,o}return r(e,t),Object.defineProperty(e.prototype,"edges",{get:function(){return s(s([],this.inEdges,!0),this.outEdges,!0)},enumerable:!1,configurable:!0}),e.prototype.remove=function(t,e){return void 0===t&&(t=!0),this._graph.removeVertex(this,t,e)},e.prototype.addInEdge=function(t){this.inEdges.push(t)},e.prototype.removeInEdge=function(t){var e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)},e.prototype.addOutEdge=function(t){this.outEdges.push(t)},e.prototype.removeOutEdge=function(t){var e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)},e}(v),b=function(t){function e(e,r,n,o,i){var s=t.call(this,e,r)||this;if(!n)throw new Error("Missing source vertex");if(!o)throw new Error("Missing target vertex");return r._addEdge(s),s.source=n,s.source.addOutEdge(s),s.target=o,s.target.addInEdge(s),s._=i,s}return r(e,t),e.prototype.remove=function(){this._graph.removeEdge(this)},e}(v),E=function(){function t(t,e){void 0===t&&(t=function(t){return""+t._}),this._allSubgraphs=[],this._allSubgraphsMap={},this._allVertices=[],this._allVerticesMap={},this._allEdges=[],this._allEdgesMap={},this.root=new _(this,null,e),this.idOf=t}return t.prototype.createSubgraph=function(t,e){var r=new _(this,t||this.root,e);return this._allSubgraphs.push(r),this._allSubgraphsMap[this.idOf(r)]=r,r},t.prototype.removeSubgraph=function(t,e){var r=this;void 0===e&&(e=!0);var n=this._allSubgraphs.indexOf(t);if(n<0)throw new Error("Subgraph does not exist");this._allSubgraphs.splice(n,1),delete this._allSubgraphsMap[this.idOf(t)],t.parent&&t.parent._removeSubgraph(t),t.edges.forEach((function(n){return e?r.removeEdge(n):t.parent._addEdge(n)})),t.vertices.forEach((function(n){return e?r.removeVertex(n,e):t.parent._addVertex(n)})),t.subgraphs.forEach((function(n){return e?r.removeSubgraph(n,e):t.parent._addSubgraph(n)}))},Object.defineProperty(t.prototype,"subgraphs",{get:function(){return this._allSubgraphs},enumerable:!1,configurable:!0}),t.prototype.subgraph=function(t){return this._allSubgraphsMap[t]},t.prototype.createVertex=function(t,e){var r=new y(this,t,e);return this._allVertices.push(r),this._allVerticesMap[this.idOf(r)]=r,r},t.prototype.removeVertex=function(t,e,r){var n=this;void 0===e&&(e=!0);var o=this._allVertices.indexOf(t);if(o<0)throw new Error("Vertex does not exist");this._allVertices.splice(o,1),delete this._allVerticesMap[this.idOf(t)],t.parent&&t.parent._removeVertex(t),e||t.inEdges.forEach((function(e){t.outEdges.forEach((function(t){n.createEdge(n.root,e.source,t.target,r?r(e.source._,t.target._):void 0)}))})),t.inEdges.forEach((function(t){return n.removeEdge(t)})),t.outEdges.forEach((function(t){return n.removeEdge(t)}))},Object.defineProperty(t.prototype,"vertices",{get:function(){return this._allVertices},enumerable:!1,configurable:!0}),t.prototype.vertex=function(t){return this._allVerticesMap[t]},t.prototype.createEdge=function(t,e,r,n){var o=new b(this,t,e,r,n);return this._allEdges.push(o),this._allEdgesMap[this.idOf(o)]=o,o},t.prototype.removeEdge=function(t){var e=this._allEdges.indexOf(t);if(e<0)throw new Error("Edge does not exist");this._allEdges.splice(e,1),delete this._allEdgesMap[this.idOf(t)],t.parent&&t.parent._removeEdge(t),t.source.removeOutEdge(t),t.target.removeInEdge(t)},Object.defineProperty(t.prototype,"edges",{get:function(){return this._allEdges},enumerable:!1,configurable:!0}),t.prototype.edge=function(t){return this._allEdgesMap[t]},t.prototype._walk=function(t,e){for(var r=0,n=t.subgraphs;r<n.length;r++){var o=n[r];switch(e(o)){case"abort":return!0;case"stepover":break;default:if(this._walk(o,e))return!0}}for(var i=0,s=t.vertices;i<s.length;i++){if("abort"===e(s[i]))return!0}},t.prototype.walk=function(t){this._walk(this.root,t);for(var e=0,r=this._allEdges;e<r.length;e++){if("abort"===t(r[e]))return!0}},t.prototype.clone=function(){var t,e,r=new(0,this.constructor)(this.idOf,this.root._),n=(t=[],e=[],{put:function(r,n){var o=t.indexOf(r);-1===o?(t.push(r),e.push(n)):e[o]=n},get:function(r){return e[t.indexOf(r)]}});return n.put(this.root,r.root),this.walk((function(t){var e=n.get(t.parent);if(t instanceof _)n.put(t,e.createSubgraph(t._));else if(t instanceof y)n.put(t,e.createVertex(t._));else if(t instanceof b){var r=n.get(t.source),o=n.get(t.target);e.createEdge(r,o,t._)}})),r},t}();var x=function(t){function e(e,r){return t.call(this,e,r)||this}return r(e,t),e.prototype.clearParent=function(){return this._parent&&(this._parent.removeChild(this),delete this._parent),this},e.prototype.parent=function(t){return 0===arguments.length?this._parent:(this._parent!==t&&(this._parent&&this._parent.removeChild(this),this._parent=t,this._parent&&this._parent.addChild(this)),this)},e}(function(){function t(t,e){this._graph=t,this._=e}return t.prototype.id=function(){return this._graph.id(this._)},t}()),w=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n._children=[],n}return r(e,t),e.prototype.children=function(){return this._children},e.prototype.addChild=function(t){this._children.push(t)},e.prototype.removeChild=function(t){this._children=this._children.filter((function(e){return e.id!==t.id}))},e}(x),m=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n._inEdges=[],n._outEdges=[],n}return r(e,t),e.prototype.edges=function(){return s(s([],this._inEdges,!0),this._outEdges,!0)},e.prototype.edgeCount=function(){return this._outEdges.length+this._inEdges.length},e.prototype.inEdges=function(){return this._inEdges},e.prototype.addInEdge=function(t){this._inEdges.push(t)},e.prototype.removeInEdge=function(t){this._inEdges=this._inEdges.filter((function(e){return e._.id!==t}))},e.prototype.outEdges=function(){return this._outEdges},e.prototype.addOutEdge=function(t){this._outEdges.push(t)},e.prototype.removeOutEdge=function(t){this._outEdges=this._outEdges.filter((function(e){return e._.id!==t}))},e}(x),M=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i._source=n,i._target=o,i}return r(e,t),e}(x),S=function(){function t(t){void 0===t&&(t=!0),this._subgraphMap={},this._vertexMap={},this._edgeMap={},this._idFunc=function(t){return"function"==typeof t.id?t.id():t.id},this._sourceFunc=function(t){return"function"==typeof t.source?t.source():t.source},this._targetFunc=function(t){return"function"==typeof t.target?t.target():t.target},this._updateFunc=function(t,e){return e},this._directed=t}return t.prototype.clear=function(){return this._subgraphMap={},this._vertexMap={},this._edgeMap={},this},t.prototype.clearParents=function(){for(var t in this._subgraphMap)this._subgraphMap[t].clearParent();for(var t in this._vertexMap)this._vertexMap[t].clearParent();return this},t.prototype.isDirected=function(){return this._directed},t.prototype.idFunc=function(t){return this._idFunc=t,this},t.prototype.sourceFunc=function(t){return this._sourceFunc=t,this},t.prototype.targetFunc=function(t){return this._targetFunc=t,this},t.prototype.updateFunc=function(t){return this._updateFunc=t,this},t.prototype.id=function(t){return this._idFunc(t)},t.prototype.type=function(t){return this.subgraphExists(t)?"S":this.vertexExists(t)?"V":this.edgeExists(t)?"E":""},t.prototype.isSubgraph=function(t){return this.subgraphExists(this.id(t))},t.prototype.isVertex=function(t){return this.vertexExists(this.id(t))},t.prototype.isEdge=function(t){return this.edgeExists(this.id(t))},t.prototype.allItems=function(){return s(s(s([],this.allSubgraphs(),!0),this.allVertices(),!0),this.allEdges(),!0)},t.prototype.item=function(t){return this.subgraphExists(t)?this.subgraph(t):this.vertexExists(t)?this.vertex(t):this.edgeExists(t)?this.edge(t):void 0},t.prototype.itemExists=function(t){return this.edgeExists(t)||this.vertexExists(t)||this.subgraphExists(t)},t.prototype.allSubgraphs=function(){var t=[];for(var e in this._subgraphMap)t.push(this._subgraphMap[e]._);return t},t.prototype.subgraphs=function(){var t=[];for(var e in this._subgraphMap)void 0===this._subgraphMap[e].parent()&&t.push(this._subgraphMap[e]._);return t},t.prototype.subgraphExists=function(t){return!!this._subgraphMap[t]},t.prototype.subgraph=function(t){return this._subgraphMap[t]._},t.prototype.subgraphSubgraphs=function(t){var e=this;return this._subgraphMap[t].children().filter((function(t){return e.isSubgraph(t._)})).map((function(t){return t._}))},t.prototype.subgraphVertices=function(t){var e=this;return this._subgraphMap[t].children().filter((function(t){return e.isVertex(t._)})).map((function(t){return t._}))},t.prototype.subgraphEdges=function(t){var e=this;return this._subgraphMap[t].children().filter((function(t){return e.isEdge(t._)})).map((function(t){return t._}))},t.prototype.addSubgraph=function(t,e){var r=this._idFunc(t);if(this._subgraphMap[r])throw new Error("Subgraph '".concat(r,"' already exists."));var n=new w(this,t);if(e){var o=this._idFunc(e);if(!this._subgraphMap[o])throw new Error("Subgraph '".concat(o,"' does not exist."));n.parent(this._subgraphMap[o])}return this._subgraphMap[r]=n,this},t.prototype.mergeSubgraphs=function(t){var e=this;void 0===t&&(t=[]);var r=u(this.allSubgraphs(),t,(function(t){return e._idFunc(t)}),this._updateFunc);return r.exit.forEach((function(t){return e.removeSubgraph(e._idFunc(t))})),r.enter.forEach((function(t){return e.addSubgraph(t)})),r.update.forEach((function(t){return e.updateSubgraph(t)})),this},t.prototype.updateSubgraph=function(t){var e=this._idFunc(t),r=this._subgraphMap[e];if(!r)throw new Error("Subgraph '".concat(e,"' does not exist."));return r._=t,this},t.prototype.removeSubgraph=function(t,e){var r=this;void 0===e&&(e=!0);var n=this._subgraphMap[t];if(!n)throw new Error("Subgraph '".concat(t,"' does not exist."));return n.children().forEach((function(t){e?t.parent(n.parent()):t instanceof w?r.removeSubgraph(t.id()):r.removeVertex(t.id())})),delete this._subgraphMap[t],this},t.prototype.subgraphParent=function(t,e){var r=this._subgraphMap[t];if(!r)throw new Error("Subgraph '".concat(t,"' does not exist."));if(void 0===e){var n=r.parent();return n?n._:void 0}var o=this._subgraphMap[e];if(!o)throw new Error("Vertex parent '".concat(o,"' does not exist."));return r.parent(o),this},t.prototype.allVertices=function(){var t=[];for(var e in this._vertexMap)t.push(this._vertexMap[e]._);return t},t.prototype.vertices=function(){var t=[];for(var e in this._vertexMap)void 0===this._vertexMap[e].parent()&&t.push(this._vertexMap[e]._);return t},t.prototype.vertexExists=function(t){return!!this._vertexMap[t]},t.prototype.vertex=function(t){return this._vertexMap[t]._},t.prototype.allEdges=function(){var t=[];for(var e in this._edgeMap)t.push(this._edgeMap[e]._);return t},t.prototype.edges=function(){var t=[];for(var e in this._edgeMap)void 0===this._edgeMap[e].parent()&&t.push(this._edgeMap[e]._);return t},t.prototype.vertexEdges=function(t){return this._vertexMap[t].edges().map((function(t){return t._}))},t.prototype.inEdges=function(t){return this._vertexMap[t].inEdges().map((function(t){return t._}))},t.prototype.outEdges=function(t){return this._vertexMap[t].outEdges().map((function(t){return t._}))},t.prototype._neighbors=function(t){return s(s([],this._vertexMap[t].outEdges().map((function(t){return t._target})),!0),this._vertexMap[t].inEdges().map((function(t){return t._source})),!0)},t.prototype.neighbors=function(t){return this._neighbors(t).map((function(t){return t._}))},t.prototype.singleNeighbors=function(t){return this._neighbors(t).filter((function(t){return 1===t.edgeCount()})).map((function(t){return t._}))},t.prototype.addVertex=function(t,e){var r=this._idFunc(t);if(this._vertexMap[r])throw new Error("Vertex '".concat(r,"' already exists."));var n=new m(this,t);if(e){var o=this._idFunc(e);if(!this.subgraphExists(o))throw new Error("Subgraph '".concat(o,"' does not exist."));n.parent(this._subgraphMap[o])}return this._vertexMap[r]=n,this},t.prototype.mergeVertices=function(t){var e=this,r=u(this.allVertices(),t,(function(t){return e._idFunc(t)}),this._updateFunc);return r.exit.forEach((function(t){return e.removeVertex(e._idFunc(t))})),r.enter.forEach((function(t){return e.addVertex(t)})),r.update.forEach((function(t){return e.updateVertex(t)})),this},t.prototype.updateVertex=function(t){var e=this._idFunc(t),r=this._vertexMap[e];if(!r)throw new Error("Vertex '".concat(e,"' does not exist."));return r._=t,this},t.prototype.removeVertex=function(t){var e=this,r=this._vertexMap[t];if(!r)throw new Error("Vertex '".concat(t,"' does not exist."));return r.edges().forEach((function(t){e.removeEdge(t.id())})),delete this._vertexMap[t],this},t.prototype.vertexParent=function(t,e){var r=this._vertexMap[t];if(!r)throw new Error("Vertex '".concat(t,"' does not exist."));if(void 0===e){var n=r.parent();return n?n._:void 0}var o=this._subgraphMap[e];if(!o)throw new Error("Vertex parent '".concat(o,"' does not exist."));return r.parent(o),this},t.prototype.edgeExists=function(t){return!!this._edgeMap[t]},t.prototype.edge=function(t){return this._edgeMap[t]._},t.prototype.addEdge=function(t,e){var r=this._idFunc(t),n=this._sourceFunc(t),o=this._targetFunc(t);if(this._edgeMap[r])throw new Error("Edge '".concat(r,"' already exists."));if(!this.vertexExists(n))throw new Error("Edge Source '".concat(n,"' does not exist."));if(!this.vertexExists(o))throw new Error("Edge Target '".concat(o,"' does not exist."));var i=new M(this,t,this._vertexMap[n],this._vertexMap[o]);if(e){var s=this._idFunc(e);if(!this.subgraphExists(s))throw new Error("Subgraph '".concat(s,"' does not exist."));i.parent(this._subgraphMap[s])}return this._edgeMap[r]=i,this._vertexMap[n].addOutEdge(i),this._vertexMap[o].addInEdge(i),this},t.prototype.mergeEdges=function(t){var e=this,r=u(this.allEdges(),t,(function(t){return e._idFunc(t)}),this._updateFunc);return r.exit.forEach((function(t){return e.removeEdge(e._idFunc(t))})),r.enter.forEach((function(t){return e.addEdge(t)})),r.update.forEach((function(t){return e.updateEdge(t)})),this},t.prototype.updateEdge=function(t){var e,r,n,o,i=this._idFunc(t),s=this._edgeMap[i];if(!s)throw new Error("Edge '".concat(i,"' does not exist."));var u=s._source.id(),a=this._sourceFunc(t);u!==a&&(null===(e=this._vertexMap[u])||void 0===e||e.removeOutEdge(i),null===(r=this._vertexMap[a])||void 0===r||r.addOutEdge(s));var c=s._target.id(),p=this._targetFunc(t);return c!==p&&(null===(n=this._vertexMap[c])||void 0===n||n.removeInEdge(i),null===(o=this._vertexMap[p])||void 0===o||o.addInEdge(s)),s._=t,s._source=this._vertexMap[a],s._target=this._vertexMap[p],this},t.prototype.removeEdge=function(t){var e=this._edgeMap[t];if(!e)throw new Error("Edge '".concat(t,"' does not exist."));var r=this._idFunc(e._source._);if(!this.vertexExists(r))throw new Error("Edge Source'".concat(r,"' does not exist."));this._vertexMap[r].removeOutEdge(t);var n=this._idFunc(e._target._);if(!this.vertexExists(n))throw new Error("Edge Target'".concat(n,"' does not exist."));return this._vertexMap[n].removeInEdge(t),delete this._edgeMap[t],this},t.prototype._hwalk=function(t,e){var r=this;return t instanceof w?e("subgraph",t._,t.children().map((function(t){return r._hwalk(t,e)}))):e("vertex",t._)},t.prototype.hierarchy=function(t){var e=[];for(var r in this._subgraphMap){var n=this._subgraphMap[r];void 0===n.parent()&&e.push(this._hwalk(n,t))}for(var r in this._vertexMap){var o=this._vertexMap[r];void 0===o.parent()&&e.push(this._hwalk(o,t))}return e},t.prototype.dijkstra=function(t,e){var r=this.allEdges(),n=new O,o={},i={},s={};function u(t,e){var r=1/0,n=null;return t.forEach((function(t){e[t]<r&&(r=e[t],n=t)})),n}for(var a=0;a<r.length;a++){var c=this._sourceFunc(r[a]),p=this._targetFunc(r[a]);n.add(c),n.add(p),i[c]=1/0,i[p]=1/0,void 0===s[c]&&(s[c]={}),void 0===s[p]&&(s[p]={}),s[c][p]=1,s[p][c]=1}for(i[t]=0;n.size;){var h=u(n,i);if(null===h)break;var f=Object.keys(s[h]).filter((function(t){return n.has(t)}));if(n.delete(h),h===e)break;for(var l=0,d=f;l<d.length;l++){var g=d[l],v=i[h]+s[h][g];v<i[g]&&(i[g]=v,o[g]=h)}}for(var _=e,y=[_],b=0;void 0!==o[_];)y.unshift(o[_]),b+=s[_][o[_]],_=o[_];return{ids:y,len:b}},t.prototype.sort=function(t){var e=[],r={},n=function(t,o){void 0===o&&(o=[]);var i=t.id();r[i]||(r[i]=!0,o.push(t),t.outEdges().forEach((function(t){o.indexOf(t._target)<0&&n(t._target,s([],o,!0))})),e.unshift(t._))};if(t)n(this._vertexMap[t]);else for(var o in this._vertexMap)n(this._vertexMap[o]);return e},t}(),O=function(){function t(){this._content=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this._content.length},enumerable:!1,configurable:!0}),t.prototype.has=function(t){return this._content.indexOf(t)>=0},t.prototype.add=function(t){this.has(t)||this._content.push(t)},t.prototype.delete=function(t){var e=this._content.indexOf(t);e>=0&&this._content.splice(e,1)},t.prototype.forEach=function(t){this._content.forEach(t)},t}(),V=Array.isArray,k=Object.keys,I=Object.prototype.hasOwnProperty;function D(t,e,r){if(void 0===r&&(r=!1),t===e)return!0;if(t&&e){if("object"==typeof t&&"object"==typeof e){var n,o=V(t),i=V(e),s=void 0,u=void 0;if(o&&i){if((n=t.length)!==e.length)return!1;for(s=n;0!=s--;)if(!D(t[s],e[s],r))return!1;return!0}if(o!==i)return!1;var a=t instanceof Date,c=e instanceof Date;if(a!==c)return!1;if(a&&c)return t.getTime()===e.getTime();var p=t instanceof RegExp,h=e instanceof RegExp;if(p!==h)return!1;if(p&&h)return t.toString()===e.toString();var f=k(t);if((n=f.length)!==k(e).length)return!1;for(s=n;0!=s--;)if(!I.call(e,f[s]))return!1;for(s=n;0!=s--;)if(!D(t[u=f[s]],e[u],r))return!1;return!0}if(!r&&"function"==typeof t&&"function"==typeof e)return t.toString()===e.toString()}return t!=t&&e!=e}var T="undefined"!=typeof globalThis?globalThis:window,F="undefined"!=typeof window&&T===window,L="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,j=L&&null!=process.env&&(null!=process.env.TRAVIS||null!=process.env.GITHUB_ACTIONS);var C,P=function(){function t(){this.stack=[]}return t.prototype.push=function(t){return this.stack.push(t),t},t.prototype.pop=function(){return this.stack.pop()},t.prototype.top=function(){return this.stack.length?this.stack[this.stack.length-1]:void 0},t.prototype.depth=function(){return this.stack.length},t}();t.Level=void 0,(C=t.Level||(t.Level={}))[C.debug=0]="debug",C[C.info=1]="info",C[C.notice=2]="notice",C[C.warning=3]="warning",C[C.error=4]="error",C[C.critical=5]="critical",C[C.alert=6]="alert",C[C.emergency=7]="emergency";var N={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},A=function(){function e(){}return e.prototype.write=function(e,r,n,o){L?console.log("[".concat(e,"] ").concat(t.Level[r].toUpperCase()," ").concat(n,": ").concat(o)):console.log("[".concat(e,"] %c").concat(t.Level[r].toUpperCase(),"%c ").concat(n,": ").concat(o),"color:".concat(N[t.Level[r]]),"")},e}(),q=function(){function e(){this._levelStack=new P,this._level=t.Level.info,this._filter="",this._writer=new A}return e.Instance=function(){return this._instance||(this._instance=new this)},e.prototype.stringify=function(t){var e=[];return JSON.stringify(t,(function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r}),2)},e.prototype.writer=function(t){return void 0===t?this._writer:(this._writer=t,this)},e.prototype.log=function(t,e,r){if(!(t<this._level||this._filter&&this._filter!==e)){var n=(new Date).toISOString();this._writer.rawWrite?this._writer.rawWrite(n,t,e,r):("string"!=typeof r&&(r=this.stringify(r)),this._writer.write&&this._writer.write(n,t,e,r))}},e.prototype.debug=function(e,r){this.log(t.Level.debug,e,r)},e.prototype.info=function(e,r){this.log(t.Level.info,e,r)},e.prototype.notice=function(e,r){this.log(t.Level.notice,e,r)},e.prototype.warning=function(e,r){this.log(t.Level.warning,e,r)},e.prototype.error=function(e,r){this.log(t.Level.error,e,r)},e.prototype.critical=function(e,r){this.log(t.Level.critical,e,r)},e.prototype.alert=function(e,r){this.log(t.Level.alert,e,r)},e.prototype.emergency=function(e,r){this.log(t.Level.emergency,e,r)},e.prototype.level=function(t){return void 0===t?this._level:(this._level=t,this)},e.prototype.pushLevel=function(t){return this._levelStack.push(this._level),this._level=t,this},e.prototype.popLevel=function(){return this._level=this._levelStack.pop(),this},e.prototype.filter=function(t){return void 0===t?this._filter:(this._filter=t,this)},e}(),X=q.Instance(),R=function(){function t(t){this._scopeID=t}return t.prototype.debug=function(t){X.debug(this._scopeID,t)},t.prototype.info=function(t){X.info(this._scopeID,t)},t.prototype.notice=function(t){X.notice(this._scopeID,t)},t.prototype.warning=function(t){X.warning(this._scopeID,t)},t.prototype.error=function(t){X.error(this._scopeID,t)},t.prototype.critical=function(t){X.critical(this._scopeID,t)},t.prototype.alert=function(t){X.alert(this._scopeID,t)},t.prototype.emergency=function(t){X.emergency(this._scopeID,t)},t.prototype.pushLevel=function(t){return X.pushLevel(t),this},t.prototype.popLevel=function(){return X.popLevel(),this},t}();function B(t,e,r){var n=r-e,o=t-e;return o-Math.floor(o/n)*n+e}function G(t,e){if(void 0!==t&&void 0!==e){for(var r=0,n=t.split(".");r<n.length;r++){var o=n[r];if(!e.hasOwnProperty(o))return;e=e[o]}return e}}function z(t,e){var r={};for(var n in e)if(e.hasOwnProperty(n)&&"__proto__"!==n&&"constructor"!==n){var o=e[n];o instanceof Array||"object"==typeof o&&(o=H(t[n],o)),n in t&&(t[n]===o||n in r&&r[n]===o)||(t[n]=o)}return t}function H(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if("object"!=typeof t)throw new Error('Destination "'.concat(t,'" must be an object.'));for(var n=0,o=e;n<o.length;n++){z(t,o[n])}return t}var U,W=function(){function t(t,e,r){this.eventTarget=t,this.eventID=e,this.callback=r}return t.prototype.release=function(){this.eventTarget.removeObserver(this.eventID,this.callback)},t.prototype.unwatch=function(){this.release()},t}(),$=function(){function t(){this._eventObservers={}}return t.prototype.addObserver=function(t,e){var r=this._eventObservers[t];return r||(r=[],this._eventObservers[t]=r),r.push(e),new W(this,t,e)},t.prototype.removeObserver=function(t,e){var r=this._eventObservers[t];if(r)for(var n=r.length-1;n>=0;--n)r[n]===e&&r.splice(n,1);return this},t.prototype.dispatchEvent=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this._eventObservers[t];if(n)for(var o=0,i=n;o<i.length;o++){i[o].apply(void 0,e)}return this},t.prototype._hasObserver=function(t){var e=this._eventObservers[t];for(var r in e)if(e[r])return!0;return!1},t.prototype.hasObserver=function(t){if(void 0!==t)return this._hasObserver(t);for(var e in this._eventObservers)if(this._hasObserver(e))return!0;return!1},t}();!function(){if(T.requestAnimationFrame)U=T.requestAnimationFrame;else{var t=0;U=function(e){var r=(new Date).getTime(),n=Math.max(0,16-(r-t)),o=setTimeout((function(){return e(r+n)}),n);return t=r+n,o}}}();var J=function(){function t(){}return Object.defineProperty(t.prototype,"canConflate",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.conflate=function(t){return!1},t.prototype.void=function(){return!1},t}(),K=function(){function t(){this._observerID=0,this._observers=[],this._messageBuffer=[]}return t.prototype.observers=function(){return this._observers},t.prototype.messages=function(){var t=[];return this._messageBuffer.forEach((function(e){t.some((function(t){return t.canConflate&&t.conflate(e)}))||t.push(e)})),t},t.prototype.dispatchAll=function(){this.dispatch(this.messages()),this.flush()},t.prototype.dispatch=function(t){0!==t.length&&this.observers().forEach((function(e){var r=t.filter((function(t){return!t.void()&&(void 0===e.type||t instanceof e.type)}));r.length&&e.callback(r)}))},t.prototype.hasObserver=function(){return this._observers.length>0},t.prototype.flush=function(){this._messageBuffer=[]},t.prototype.send=function(t){this.dispatch([t])},t.prototype.post=function(t){var e=this;this._messageBuffer.push(t),U((function(){return e.dispatchAll()}))},t.prototype.attach=function(t,e){var r=this,n=++this._observerID;return this._observers.push({id:n,type:e,callback:t}),{release:function(){r._observers=r._observers.filter((function(t){return t.id!==n}))},unwatch:function(){this.release()}}},t}(),Q=function(){function t(t){this.name="",this.$={},this._children=[],this.content="",this.name=t}return t.prototype.appendAttribute=function(t,e){this.$[t]=e},t.prototype.appendContent=function(t){this.content+=t},t.prototype.appendChild=function(t){this._children.push(t)},t.prototype.children=function(t){return void 0===t?this._children:this._children.filter((function(e){return e.name===t}))},t}(),Y=function(){function t(){this.stack=new P}return t.prototype.walkDoc=function(t){var e=this._startXMLNode(t);if(t.attributes)for(var r=0;r<t.attributes.length;++r){var n=t.attributes.item(r);this.attributes(n.nodeName,n.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(r=0;r<t.childNodes.length;++r){var o=t.childNodes.item(r);o.nodeType===o.TEXT_NODE?this.characters(o.nodeValue):this.walkDoc(o)}this.endXMLNode(this.stack.pop())},t.prototype._startXMLNode=function(t){var e=new Q(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)},t.prototype.parse=function(t){var e=(new DOMParser).parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()},t.prototype.startDocument=function(){},t.prototype.endDocument=function(){},t.prototype.startXMLNode=function(t){},t.prototype.endXMLNode=function(t){},t.prototype.attributes=function(t,e){this.stack.top().appendAttribute(t,e)},t.prototype.characters=function(t){this.stack.top().appendContent(t)},t}(),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.startXMLNode=function(e){t.prototype.startXMLNode.call(this,e),e.name},e.prototype.endXMLNode=function(e){e.name,t.prototype.endXMLNode.call(this,e)},e}(Y);var tt=function(t){function e(e,r,n){var o=t.call(this)||this;return o.property=e,o.newValue=r,o.oldValue=n,o}return r(e,t),Object.defineProperty(e.prototype,"canConflate",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.conflate=function(t){return this.property===t.property&&(this.newValue=t.newValue,!0)},e.prototype.void=function(){return D(this.newValue,this.oldValue)},e}(J),et=function(){function t(){this._espState={},this._dispatch=new K,this._monitorTickCount=0}return t.prototype.clear=function(t){this._espState={},void 0!==t&&this.set(t),this._monitorTickCount=0},t.prototype.get=function(t,e){return void 0===t?this._espState:this.has(t)?this._espState[t]:e},t.prototype.set=function(t,e){if("string"==typeof t)return this.setSingle(t,e);this.setAll(t)},t.prototype.setSingle=function(t,e){var r=this._espState[t];this._espState[t]=e,this._dispatch.post(new tt(t,e,r))},t.prototype.setAll=function(t){for(var e in t)t.hasOwnProperty(e)&&this.setSingle(e,t[e])},t.prototype.has=function(t){return void 0!==this._espState[t]},t.prototype.addObserver=function(t,e,r){if(this.isCallback(e)){if("changed"!==t)throw new Error("Invalid eventID: "+t);return this._dispatch.attach((function(t){e(t.map((function(t){return{id:t.property,oldValue:t.oldValue,newValue:t.newValue}})))}))}if("propChanged"!==t)throw new Error("Invalid eventID: "+t);return this._dispatch.attach((function(t){var n=t.filter((function(t){return t.property===e}));if(n.length){n.length>1&&console.warn("Should only be 1 message?");var o=n[n.length-1];r({id:o.property,oldValue:o.oldValue,newValue:o.newValue})}}))},t.prototype.on=function(t,e,r){return this.addObserver(t,e,r),this},t.prototype.isCallback=function(t){return"function"==typeof t},t.prototype.hasEventListener=function(){return this._dispatch.hasObserver()},t.prototype.refresh=function(){return o(this,arguments,void 0,(function(t){return i(this,(function(t){switch(t.label){case 0:return[4,Promise.resolve()];case 1:return t.sent(),[2,this]}}))}))},t.prototype._monitor=function(){var t=this;this._monitorHandle?this._monitorTickCount=0:this._monitorHandle=setTimeout((function(){(t.hasEventListener()?t.refresh():Promise.resolve()).then((function(){t._monitor()})),delete t._monitorHandle}),this._monitorTimeoutDuration())},t.prototype._monitorTimeoutDuration=function(){return++this._monitorTickCount,this._monitorTickCount<=1?0:3e4},t.prototype.watch=function(t,e){var r=this;if(void 0===e&&(e=!0),"function"!=typeof t)throw new Error("Invalid Callback");e&&setTimeout((function(){var e=r.get(),n=[];for(var o in e)e.hasOwnProperty(e)&&n.push({id:o,newValue:e[o],oldValue:void 0});t(n)}),0);var n=this.addObserver("changed",t);return this._monitor(),n},t}();function rt(t,e,r){var n=t.toString();("number"!=typeof r||!isFinite(r)||Math.floor(r)!==r||r>n.length)&&(r=n.length),r-=e.length;var o=n.lastIndexOf(e,r);return-1!==o&&o===r}function nt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=[],n=0,o=t.reduce((function(t,e){return t.length>0&&(e=e.replace(/^\//,"")),e=e.replace(/\/$/,""),s(s([],t,!0),e.split("/"),!0)}),[]);n<o.length;n++){var i=o[n];"."!==i&&(".."!==i?r.push(i):r.pop())}return r.join("/")}t.AsyncCache=f,t.AsyncOrderedQueue=l,t.BUILD_VERSION="2.106.0",t.Cache=h,t.Dictionary=d,t.DictionaryNoCase=g,t.Dispatch=K,t.Edge=b,t.Graph=E,t.Graph2=S,t.GraphItem=v,t.Logging=q,t.Message=J,t.Observable=$,t.PKG_NAME="@hpcc-js/util",t.PKG_VERSION="2.52.0",t.SAXStackParser=Y,t.ScopedLogging=R,t.Stack=P,t.StateObject=et,t.Subgraph=_,t.Vertex=y,t.XMLNode=Q,t.cartesianToPolar=function(t,e){return{r:Math.sqrt(t*t+e*e),theta:Math.atan2(e,t)}},t.classID2Meta=function(t){var e=t.split("_"),r=e[1].split(".");return{module:"@hpcc-js/".concat(e[0]),file:r[0],class:r[1]||r[0]}},t.compare=function(t,e){for(var r={update:[],exit:[],enter:s([],e,!0)},n=0,o=t;n<o.length;n++){var i=o[n],u=r.enter.indexOf(i);u>=0?(r.update.push(i),r.enter.splice(u,1)):r.exit.push(i)}return r},t.compare2=u,t.debounce=function(t,e){var r={};return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=p(n);return r[i]||(r[i]={clockStart:Date.now(),promise:t.apply(void 0,n).then((function(t){return void 0===e?r[i]=null:setTimeout((function(){r[i]=null}),Math.max(e-(Date.now()-r[i].clockStart),0)),t})).catch((function(t){throw r[i]=null,t}))}),r[i].promise}},t.deepEquals=D,t.deepMixin=H,t.deepMixinT=function(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return H.apply(void 0,s([t],e,!1))},t.degreesToRadians=function(t){return t*(Math.PI/180)},t.dirname=function(t){return nt(t,"..")},t.endsWith=rt,t.espTime2Seconds=function(t){if(!t)return 0;if(!isNaN(Number(t)))return Number(t);var e=t.indexOf("ns");if(-1!==e)return parseFloat(t.substr(0,e))/1e9;var r=t.indexOf("ms");if(-1!==r)return parseFloat(t.substr(0,r))/1e3;var n=t.indexOf("s");if(-1!==n&&-1===t.indexOf("days"))return parseFloat(t.substr(0,n));for(var o=t.split(" days "),i=o.length>1?parseFloat(o[0]):0,s=0,u=(o.length>1?o[1]:o[0]).split(":").reverse(),a=0;a<u.length;++a)s+=parseFloat(u[a])*Math.pow(60,a);return 24*i*60*60+s},t.exists=function(t,e){return void 0!==G(t,e)},t.find=function(t,e){if(null==t)throw new TypeError('"o" is null or not defined');var r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},t.getScriptSrc=function(t){for(var e=document.scripts||[],r=document.scripts.length-1;r>=0;--r){var n=e[r];if(n.src){var o=n.src.indexOf(t);if(o>=0)return n.src.substring(0,o)}}return""},t.hashSum=p,t.inner=G,t.isArray=function(t){return void 0!==Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},t.isBrowser=F,t.isCI=j,t.isNode=L,t.join=nt,t.logger=X,t.normalize=B,t.normalizeDegrees=function(t,e,r){return void 0===e&&(e=-180),void 0===r&&(r=180),B(t,e,r)},t.normalizeRadians=function(t,e,r){return void 0===e&&(e=-Math.PI),void 0===r&&(r=Math.PI),B(t,e,r)},t.polarToCartesian=function(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)}},t.promiseTimeout=function(t,e){var r,n=new Promise((function(e,n){r=setTimeout((function(){clearTimeout(r),n("Timed out in "+t+"ms.")}),t)}));return Promise.race([e,n]).then((function(t){return clearTimeout(r),t})).catch((function(t){throw clearTimeout(r),t}))},t.radiansToDegrees=function(t){return t*(180/Math.PI)},t.root=T,t.safeStringify=function(t){var e=[];return JSON.stringify(t,(function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r}))},t.scopedLogger=function(t,e){return void 0===e&&(e=!1),e&&X.filter(t),new R(t)},t.sleep=function(t){return new Promise((function(e){setTimeout((function(){return e()}),t)}))},t.trim=function(t,e){if("string"!=typeof e)return t;if(0===e.length)return t;for(;0===t.indexOf(e);)t=t.substring(1);for(;rt(t,e);)t=t.substring(0,t.length-1);return t},t.update=function(t,e,r){return void 0===r&&(r=!1),D(t,e,r)?t:e},t.verboseDeepEquals=function t(e,r,n){if(void 0===n&&(n=!1),e===r)return!0;if(e&&r){if("object"==typeof e&&"object"==typeof r){var o,i=V(e),s=V(r),u=void 0,a=void 0;if(i&&s){if((o=e.length)!==r.length)return console.warn("lengths not equal: ".concat(o," !== ").concat(r.length)),!1;for(u=o;0!=u--;)if(!t(e[u],r[u],n))return!1;return!0}if(i!==s)return console.warn("arrays not equal: ".concat(i," !== ").concat(s)),!1;var c=e instanceof Date,p=r instanceof Date;if(c!==p)return console.warn("dates not equal: ".concat(c," !== ").concat(p)),!1;if(c&&p){var h=e.getTime()===r.getTime();return h||console.warn("dates not equal: ".concat(e.getTime()," !== ").concat(r.getTime())),h}var f=e instanceof RegExp,l=r instanceof RegExp;if(f!==l)return console.warn("regexps not equal: ".concat(f," !== ").concat(l)),!1;if(f&&l){var d=e.toString()===r.toString();return d||console.warn("regexps not equal: ".concat(e.toString()," !== ").concat(r.toString())),d}var g=k(e);if((o=g.length)!==k(r).length)return console.warn("key lengths not equal: ".concat(o," !== ").concat(k(r).length)),!1;for(u=o;0!=u--;)if(!I.call(r,g[u]))return console.warn("".concat(g[u]," in a but not b")),!1;for(u=o;0!=u--;)if(!t(e[a=g[u]],r[a],n))return!1;return!0}if(!n&&"function"==typeof e&&"function"==typeof r){var v=e.toString()===r.toString();return v||console.warn("functions not equal: ".concat(e.toString()," !== ").concat(r.toString())),v}}var _=e!=e&&r!=r;return _||console.warn("values not equal: ".concat(e," !== ").concat(r)),_},t.xml2json=function(t){var e=new Z;return e.parse(t),e.root}}));
2
- //# sourceMappingURL=index.min.js.map