@spscommerce/utils 5.4.1 → 5.5.0-ie
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pnpm-debug.log +20 -0
- package/{lib → dist/out-tsc}/array/flatten.d.ts +0 -0
- package/dist/out-tsc/array/flatten.js +7 -0
- package/dist/out-tsc/array/flatten.js.map +1 -0
- package/{lib → dist/out-tsc}/array/flatten.spec.d.ts +0 -0
- package/dist/out-tsc/array/flatten.spec.js +10 -0
- package/dist/out-tsc/array/flatten.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/array/index.d.ts +0 -0
- package/dist/out-tsc/array/index.js +4 -0
- package/dist/out-tsc/array/index.js.map +1 -0
- package/{lib → dist/out-tsc}/array/is-subset.d.ts +0 -0
- package/dist/out-tsc/array/is-subset.js +41 -0
- package/dist/out-tsc/array/is-subset.js.map +1 -0
- package/{lib → dist/out-tsc}/array/is-subset.spec.d.ts +0 -0
- package/dist/out-tsc/array/is-subset.spec.js +41 -0
- package/dist/out-tsc/array/is-subset.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/array/range.d.ts +0 -0
- package/dist/out-tsc/array/range.js +16 -0
- package/dist/out-tsc/array/range.js.map +1 -0
- package/{lib → dist/out-tsc}/array/range.spec.d.ts +0 -0
- package/dist/out-tsc/array/range.spec.js +26 -0
- package/dist/out-tsc/array/range.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/classes/custom-event.d.ts +0 -0
- package/dist/out-tsc/classes/custom-event.js +87 -0
- package/dist/out-tsc/classes/custom-event.js.map +1 -0
- package/{lib → dist/out-tsc}/classes/index.d.ts +0 -0
- package/dist/out-tsc/classes/index.js +2 -0
- package/dist/out-tsc/classes/index.js.map +1 -0
- package/{lib → dist/out-tsc}/data/doctypes.d.ts +0 -0
- package/dist/out-tsc/data/doctypes.js +302 -0
- package/dist/out-tsc/data/doctypes.js.map +1 -0
- package/{lib → dist/out-tsc}/data/index.d.ts +0 -0
- package/dist/out-tsc/data/index.js +2 -0
- package/dist/out-tsc/data/index.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/cast-to-number.d.ts +0 -0
- package/dist/out-tsc/decorators/cast-to-number.js +29 -0
- package/dist/out-tsc/decorators/cast-to-number.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/debounced.broken_spec.d.ts +0 -0
- package/dist/out-tsc/decorators/debounced.broken_spec.js +38 -0
- package/dist/out-tsc/decorators/debounced.broken_spec.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/debounced.d.ts +0 -0
- package/dist/out-tsc/decorators/debounced.js +35 -0
- package/dist/out-tsc/decorators/debounced.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/index.d.ts +0 -0
- package/dist/out-tsc/decorators/index.js +6 -0
- package/dist/out-tsc/decorators/index.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/locked-to-animation-frames.d.ts +0 -0
- package/dist/out-tsc/decorators/locked-to-animation-frames.js +34 -0
- package/dist/out-tsc/decorators/locked-to-animation-frames.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/locked-to-animation-frames.spec.d.ts +0 -0
- package/dist/out-tsc/decorators/locked-to-animation-frames.spec.js +63 -0
- package/dist/out-tsc/decorators/locked-to-animation-frames.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/simple-metadata-decorator-applicator.d.ts +0 -0
- package/dist/out-tsc/decorators/simple-metadata-decorator-applicator.js +80 -0
- package/dist/out-tsc/decorators/simple-metadata-decorator-applicator.js.map +1 -0
- package/{lib → dist/out-tsc}/decorators/tick-delay.d.ts +0 -0
- package/dist/out-tsc/decorators/tick-delay.js +31 -0
- package/dist/out-tsc/decorators/tick-delay.js.map +1 -0
- package/{lib → dist/out-tsc}/function/debounce.d.ts +0 -0
- package/dist/out-tsc/function/debounce.js +102 -0
- package/dist/out-tsc/function/debounce.js.map +1 -0
- package/{lib → dist/out-tsc}/function/debounce.spec.d.ts +0 -0
- package/dist/out-tsc/function/debounce.spec.js +150 -0
- package/dist/out-tsc/function/debounce.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/function/debounced-function.interface.d.ts +0 -0
- package/dist/out-tsc/function/debounced-function.interface.js +2 -0
- package/dist/out-tsc/function/debounced-function.interface.js.map +1 -0
- package/{lib → dist/out-tsc}/function/delayed-function.interface.d.ts +0 -0
- package/dist/out-tsc/function/delayed-function.interface.js +2 -0
- package/dist/out-tsc/function/delayed-function.interface.js.map +1 -0
- package/{lib → dist/out-tsc}/function/index.d.ts +0 -0
- package/dist/out-tsc/function/index.js +7 -0
- package/dist/out-tsc/function/index.js.map +1 -0
- package/{lib → dist/out-tsc}/function/lock-to-animation-frames.d.ts +0 -0
- package/dist/out-tsc/function/lock-to-animation-frames.js +43 -0
- package/dist/out-tsc/function/lock-to-animation-frames.js.map +1 -0
- package/{lib → dist/out-tsc}/function/lock-to-animation-frames.spec.d.ts +0 -0
- package/dist/out-tsc/function/lock-to-animation-frames.spec.js +53 -0
- package/dist/out-tsc/function/lock-to-animation-frames.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/function/on-next-tick.d.ts +0 -0
- package/dist/out-tsc/function/on-next-tick.js +12 -0
- package/dist/out-tsc/function/on-next-tick.js.map +1 -0
- package/{lib → dist/out-tsc}/function/on-next-tick.spec.d.ts +0 -0
- package/dist/out-tsc/function/on-next-tick.spec.js +13 -0
- package/dist/out-tsc/function/on-next-tick.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/function/op.d.ts +0 -0
- package/dist/out-tsc/function/op.js +34 -0
- package/dist/out-tsc/function/op.js.map +1 -0
- package/{lib → dist/out-tsc}/function/op.spec.d.ts +0 -0
- package/dist/out-tsc/function/op.spec.js +94 -0
- package/dist/out-tsc/function/op.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/index.d.ts +0 -0
- package/dist/out-tsc/index.js +10 -0
- package/dist/out-tsc/index.js.map +1 -0
- package/{lib → dist/out-tsc}/number/constrain.d.ts +0 -0
- package/dist/out-tsc/number/constrain.js +16 -0
- package/dist/out-tsc/number/constrain.js.map +1 -0
- package/{lib → dist/out-tsc}/number/decimal-round.d.ts +0 -0
- package/dist/out-tsc/number/decimal-round.js +19 -0
- package/dist/out-tsc/number/decimal-round.js.map +1 -0
- package/{lib → dist/out-tsc}/number/decimal-round.spec.d.ts +0 -0
- package/dist/out-tsc/number/decimal-round.spec.js +10 -0
- package/dist/out-tsc/number/decimal-round.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/number/index.d.ts +0 -0
- package/dist/out-tsc/number/index.js +4 -0
- package/dist/out-tsc/number/index.js.map +1 -0
- package/{lib → dist/out-tsc}/number/to-file-size-string.d.ts +0 -0
- package/dist/out-tsc/number/to-file-size-string.js +24 -0
- package/dist/out-tsc/number/to-file-size-string.js.map +1 -0
- package/{lib → dist/out-tsc}/object/copy-property.d.ts +0 -0
- package/dist/out-tsc/object/copy-property.js +9 -0
- package/dist/out-tsc/object/copy-property.js.map +1 -0
- package/{lib → dist/out-tsc}/object/copy-property.spec.d.ts +0 -0
- package/dist/out-tsc/object/copy-property.spec.js +16 -0
- package/dist/out-tsc/object/copy-property.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/crumble-path.d.ts +0 -0
- package/dist/out-tsc/object/crumble-path.js +9 -0
- package/dist/out-tsc/object/crumble-path.js.map +1 -0
- package/{lib → dist/out-tsc}/object/crumble-path.spec.d.ts +0 -0
- package/dist/out-tsc/object/crumble-path.spec.js +24 -0
- package/dist/out-tsc/object/crumble-path.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/deep-freeze.d.ts +0 -0
- package/dist/out-tsc/object/deep-freeze.js +36 -0
- package/dist/out-tsc/object/deep-freeze.js.map +1 -0
- package/{lib → dist/out-tsc}/object/deep-freeze.spec.d.ts +0 -0
- package/dist/out-tsc/object/deep-freeze.spec.js +14 -0
- package/dist/out-tsc/object/deep-freeze.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/diff.d.ts +0 -0
- package/dist/out-tsc/object/diff.js +92 -0
- package/dist/out-tsc/object/diff.js.map +1 -0
- package/{lib → dist/out-tsc}/object/diff.spec.d.ts +0 -0
- package/dist/out-tsc/object/diff.spec.js +40 -0
- package/dist/out-tsc/object/diff.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/for-each-entry-deep.d.ts +0 -0
- package/dist/out-tsc/object/for-each-entry-deep.js +38 -0
- package/dist/out-tsc/object/for-each-entry-deep.js.map +1 -0
- package/{lib → dist/out-tsc}/object/for-each-entry-deep.spec.d.ts +0 -0
- package/dist/out-tsc/object/for-each-entry-deep.spec.js +24 -0
- package/dist/out-tsc/object/for-each-entry-deep.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/for-each-nested-object.d.ts +0 -0
- package/dist/out-tsc/object/for-each-nested-object.js +38 -0
- package/dist/out-tsc/object/for-each-nested-object.js.map +1 -0
- package/{lib → dist/out-tsc}/object/for-each-nested-object.spec.d.ts +0 -0
- package/dist/out-tsc/object/for-each-nested-object.spec.js +46 -0
- package/dist/out-tsc/object/for-each-nested-object.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/get-path.d.ts +0 -0
- package/dist/out-tsc/object/get-path.js +67 -0
- package/dist/out-tsc/object/get-path.js.map +1 -0
- package/{lib → dist/out-tsc}/object/get-path.spec.d.ts +0 -0
- package/dist/out-tsc/object/get-path.spec.js +44 -0
- package/dist/out-tsc/object/get-path.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/index.d.ts +0 -0
- package/dist/out-tsc/object/index.js +14 -0
- package/dist/out-tsc/object/index.js.map +1 -0
- package/{lib → dist/out-tsc}/object/merge-deep.d.ts +0 -0
- package/dist/out-tsc/object/merge-deep.js +60 -0
- package/dist/out-tsc/object/merge-deep.js.map +1 -0
- package/{lib → dist/out-tsc}/object/merge-deep.spec.d.ts +0 -0
- package/dist/out-tsc/object/merge-deep.spec.js +16 -0
- package/dist/out-tsc/object/merge-deep.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/merge-properties-deep.d.ts +0 -0
- package/dist/out-tsc/object/merge-properties-deep.js +61 -0
- package/dist/out-tsc/object/merge-properties-deep.js.map +1 -0
- package/{lib → dist/out-tsc}/object/merge-properties-deep.spec.d.ts +0 -0
- package/dist/out-tsc/object/merge-properties-deep.spec.js +24 -0
- package/dist/out-tsc/object/merge-properties-deep.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/omit.d.ts +0 -0
- package/dist/out-tsc/object/omit.js +40 -0
- package/dist/out-tsc/object/omit.js.map +1 -0
- package/{lib → dist/out-tsc}/object/omit.spec.d.ts +0 -0
- package/dist/out-tsc/object/omit.spec.js +10 -0
- package/dist/out-tsc/object/omit.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/set-path.d.ts +0 -0
- package/dist/out-tsc/object/set-path.js +45 -0
- package/dist/out-tsc/object/set-path.js.map +1 -0
- package/{lib → dist/out-tsc}/object/set-path.spec.d.ts +0 -0
- package/dist/out-tsc/object/set-path.spec.js +36 -0
- package/dist/out-tsc/object/set-path.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/object/traverse-path.d.ts +0 -0
- package/dist/out-tsc/object/traverse-path.js +81 -0
- package/dist/out-tsc/object/traverse-path.js.map +1 -0
- package/{lib → dist/out-tsc}/object/values.d.ts +0 -0
- package/dist/out-tsc/object/values.js +31 -0
- package/dist/out-tsc/object/values.js.map +1 -0
- package/{lib → dist/out-tsc}/object/values.spec.d.ts +0 -0
- package/dist/out-tsc/object/values.spec.js +7 -0
- package/dist/out-tsc/object/values.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/string/code.template-tag.d.ts +0 -0
- package/dist/out-tsc/string/code.template-tag.js +38 -0
- package/dist/out-tsc/string/code.template-tag.js.map +1 -0
- package/{lib → dist/out-tsc}/string/index.d.ts +0 -0
- package/dist/out-tsc/string/index.js +4 -0
- package/dist/out-tsc/string/index.js.map +1 -0
- package/{lib → dist/out-tsc}/string/parse-file-size.d.ts +0 -0
- package/dist/out-tsc/string/parse-file-size.js +43 -0
- package/dist/out-tsc/string/parse-file-size.js.map +1 -0
- package/{lib → dist/out-tsc}/string/template.d.ts +0 -0
- package/dist/out-tsc/string/template.js +28 -0
- package/dist/out-tsc/string/template.js.map +1 -0
- package/{lib → dist/out-tsc}/string/template.spec.d.ts +0 -0
- package/dist/out-tsc/string/template.spec.js +39 -0
- package/dist/out-tsc/string/template.spec.js.map +1 -0
- package/{lib → dist/out-tsc}/typings.d.ts +0 -0
- package/dist/out-tsc/typings.js +2 -0
- package/dist/out-tsc/typings.js.map +1 -0
- package/package.json +5 -5
- package/rollup.config.js +22 -0
- package/vite.config.js +1 -1
- package/lib/index.cjs.js +0 -1
- package/lib/index.es.js +0 -1024
package/lib/index.es.js
DELETED
|
@@ -1,1024 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
function _mergeNamespaces(n, m) {
|
|
18
|
-
m.forEach(function(e) {
|
|
19
|
-
Object.keys(e).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !(k in n)) {
|
|
21
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function() {
|
|
25
|
-
return e[k];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
return Object.freeze(n);
|
|
32
|
-
}
|
|
33
|
-
function flatten(arg) {
|
|
34
|
-
if (!Array.isArray(arg)) {
|
|
35
|
-
return arg;
|
|
36
|
-
}
|
|
37
|
-
return arg.reduce((acc, x) => acc.concat(flatten(x)), []);
|
|
38
|
-
}
|
|
39
|
-
function isSubset(candidate, array) {
|
|
40
|
-
const set = new Set(array);
|
|
41
|
-
for (const member of candidate) {
|
|
42
|
-
if (!set.has(member)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
function resetDebouncedFn() {
|
|
49
|
-
this.pending = false;
|
|
50
|
-
if (typeof this.id === "number") {
|
|
51
|
-
clearTimeout(this.id);
|
|
52
|
-
delete this.id;
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
function debounce(functionToDebounce, milliseconds, thisArg) {
|
|
58
|
-
const debFn = function debouncedFn(...args) {
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
debFn.reset();
|
|
61
|
-
debFn.pending = true;
|
|
62
|
-
function executor() {
|
|
63
|
-
void (async () => {
|
|
64
|
-
try {
|
|
65
|
-
let output = functionToDebounce.apply(thisArg || this, args);
|
|
66
|
-
if (output instanceof Promise) {
|
|
67
|
-
output = await output;
|
|
68
|
-
}
|
|
69
|
-
resolve(output);
|
|
70
|
-
} catch (err) {
|
|
71
|
-
reject(err);
|
|
72
|
-
} finally {
|
|
73
|
-
debFn.reset();
|
|
74
|
-
}
|
|
75
|
-
})();
|
|
76
|
-
}
|
|
77
|
-
debFn.id = window.setTimeout(executor, milliseconds);
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
debFn.reset = resetDebouncedFn.bind(debFn);
|
|
81
|
-
return debFn;
|
|
82
|
-
}
|
|
83
|
-
function resetLockedFn() {
|
|
84
|
-
this.pending = false;
|
|
85
|
-
if (typeof this.id === "number") {
|
|
86
|
-
window.cancelAnimationFrame(this.id);
|
|
87
|
-
delete this.id;
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
function lockToAnimationFrames(functionToLock, thisArg) {
|
|
93
|
-
const lockFn = function lockedFn(...args) {
|
|
94
|
-
if (lockFn.pending) {
|
|
95
|
-
lockFn.reset();
|
|
96
|
-
}
|
|
97
|
-
lockFn.id = window.requestAnimationFrame(() => {
|
|
98
|
-
if (functionToLock) {
|
|
99
|
-
functionToLock.apply(thisArg || this, args);
|
|
100
|
-
}
|
|
101
|
-
lockFn.reset();
|
|
102
|
-
});
|
|
103
|
-
lockFn.pending = true;
|
|
104
|
-
};
|
|
105
|
-
lockFn.pending = false;
|
|
106
|
-
lockFn.reset = resetLockedFn.bind(lockFn);
|
|
107
|
-
return lockFn;
|
|
108
|
-
}
|
|
109
|
-
function onNextTick(fn, thisArg) {
|
|
110
|
-
const boundFn = thisArg ? fn.bind(thisArg) : fn;
|
|
111
|
-
setTimeout(boundFn, 0);
|
|
112
|
-
}
|
|
113
|
-
const Op = {
|
|
114
|
-
add: (a, b) => a + b,
|
|
115
|
-
and: (a, b) => a && b,
|
|
116
|
-
band: (a, b) => a & b,
|
|
117
|
-
bor: (a, b) => a | b,
|
|
118
|
-
bxor: (a, b) => a ^ b,
|
|
119
|
-
bnot: (a) => ~a,
|
|
120
|
-
decr: (a) => a - 1,
|
|
121
|
-
div: (a, b) => a / b,
|
|
122
|
-
eq: (a, b) => a === b,
|
|
123
|
-
exp: (a, b) => a ** b,
|
|
124
|
-
gt: (a, b) => a > b,
|
|
125
|
-
gte: (a, b) => a >= b,
|
|
126
|
-
incr: (a) => a + 1,
|
|
127
|
-
lshift: (a, b) => a << b,
|
|
128
|
-
lt: (a, b) => a < b,
|
|
129
|
-
lte: (a, b) => a <= b,
|
|
130
|
-
mul: (a, b) => a * b,
|
|
131
|
-
neg: (a) => -a,
|
|
132
|
-
neq: (a, b) => a !== b,
|
|
133
|
-
not: (a) => !a,
|
|
134
|
-
or: (a, b) => a || b,
|
|
135
|
-
rem: (a, b) => a % b,
|
|
136
|
-
rshift: (a, b) => a >> b,
|
|
137
|
-
rshift_zf: (a, b) => a >>> b,
|
|
138
|
-
sub: (a, b) => a - b,
|
|
139
|
-
xor: (a, b) => (a || b) && !(a && b)
|
|
140
|
-
};
|
|
141
|
-
function range(start, end) {
|
|
142
|
-
if (!Number.isInteger(start)) {
|
|
143
|
-
throw new Error("start must be an integer");
|
|
144
|
-
}
|
|
145
|
-
if (!Number.isInteger(end)) {
|
|
146
|
-
throw new Error("end must be an integer");
|
|
147
|
-
}
|
|
148
|
-
return new Array(Math.abs(end - start) + 1).fill(start).map(start > end ? Op.sub : Op.add);
|
|
149
|
-
}
|
|
150
|
-
class CustomEvent {
|
|
151
|
-
constructor(eventName, initDict = {}) {
|
|
152
|
-
let event;
|
|
153
|
-
if (typeof Event === "function") {
|
|
154
|
-
event = new Event(eventName, initDict);
|
|
155
|
-
} else {
|
|
156
|
-
event = document.createEvent("Event");
|
|
157
|
-
event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
|
|
158
|
-
for (const key of Object.keys(initDict)) {
|
|
159
|
-
if (key !== "bubbles" && key !== "cancelable") {
|
|
160
|
-
event[key] = initDict[key];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
Object.setPrototypeOf(this, event);
|
|
165
|
-
const descriptors = Object.getOwnPropertyDescriptors(Event.prototype);
|
|
166
|
-
for (const propKey of Object.keys(descriptors)) {
|
|
167
|
-
const descriptor = descriptors[propKey];
|
|
168
|
-
for (const key of Object.keys(descriptor)) {
|
|
169
|
-
if (typeof descriptor[key] === "function") {
|
|
170
|
-
descriptor[key] = descriptor[key].bind(event);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
Object.defineProperties(this, descriptors);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
const EDI_DOCUMENT_TYPE = Object.freeze({
|
|
178
|
-
100: { name: "Insurance Plan Description" },
|
|
179
|
-
101: { name: "Name and Address Lists" },
|
|
180
|
-
104: { name: "Air Shipment Information" },
|
|
181
|
-
106: { name: "Motor Carrier Rate Proposal" },
|
|
182
|
-
107: { name: "Request for Motor Carrier Rate Proposal" },
|
|
183
|
-
108: { name: "Response to a Motor Carrier Rate Proposal" },
|
|
184
|
-
109: { name: "Vessel Content Details" },
|
|
185
|
-
110: { name: "Air Freight Details and Invoice" },
|
|
186
|
-
112: { name: "Property Damage Report" },
|
|
187
|
-
120: { name: "Vehicle Shipping Order" },
|
|
188
|
-
121: { name: "Vehicle Service" },
|
|
189
|
-
124: { name: "Vehicle Damage" },
|
|
190
|
-
125: { name: "Multilevel Railcar Load Details" },
|
|
191
|
-
126: { name: "Vehicle Application Advice" },
|
|
192
|
-
127: { name: "Vehicle Baying Order" },
|
|
193
|
-
128: { name: "Dealer Information" },
|
|
194
|
-
129: { name: "Vehicle Carrier Rate Update" },
|
|
195
|
-
130: { name: "Student Educational Record (Transcript)" },
|
|
196
|
-
131: { name: "Student Educational Record (Transcript) Acknowledgment" },
|
|
197
|
-
135: { name: "Student Loan Application" },
|
|
198
|
-
138: { name: "Testing Results Request and Report" },
|
|
199
|
-
139: { name: "Student Loan Guarantee Result" },
|
|
200
|
-
140: { name: "Product Registration" },
|
|
201
|
-
141: { name: "Product Service Claim Response" },
|
|
202
|
-
142: { name: "Product Service Claim" },
|
|
203
|
-
143: { name: "Product Service Notification" },
|
|
204
|
-
144: { name: "Student Loan Transfer and Status Verification" },
|
|
205
|
-
146: { name: "Request for Student Educational Record (Transcript)" },
|
|
206
|
-
147: { name: "Response to Request for Student Educational Record (Transcript)" },
|
|
207
|
-
148: { name: "Report of Injury, Illness or Incident" },
|
|
208
|
-
149: { name: "Notice of Tax Adjustment or Assessment" },
|
|
209
|
-
150: { name: "Tax Rate Notification" },
|
|
210
|
-
151: { name: "Electronic Filing of Tax Return Data Acknowledgment" },
|
|
211
|
-
152: { name: "Statistical Government Information" },
|
|
212
|
-
153: { name: "Unemployment Insurance Tax Claim or Charge Information" },
|
|
213
|
-
154: { name: "Uniform Commercial Code Filing" },
|
|
214
|
-
155: { name: "Business Credit Report" },
|
|
215
|
-
157: { name: "Notice of Power of Attorney" },
|
|
216
|
-
159: { name: "Motion Picture Booking Confirmation" },
|
|
217
|
-
160: { name: "Transportation Automatic Equipment Identification" },
|
|
218
|
-
161: { name: "Train Sheet" },
|
|
219
|
-
169: { name: "Transportation Appointment Schedule Information" },
|
|
220
|
-
170: { name: "Revenue Receipts Statement" },
|
|
221
|
-
175: { name: "Court and Law Enforcement Notice" },
|
|
222
|
-
176: { name: "Court Submission TYPE" },
|
|
223
|
-
180: { name: "Return Merchandise Authorization and Notification" },
|
|
224
|
-
185: { name: "Royalty Regulatory Report" },
|
|
225
|
-
186: { name: "Insurance Underwriting Requirements Reporting" },
|
|
226
|
-
188: { name: "Educational Course Inventory" },
|
|
227
|
-
189: { name: "Application for Admission to Educational Institutions" },
|
|
228
|
-
190: { name: "Student Enrollment Verification" },
|
|
229
|
-
191: { name: "Student Loan Pre-Claims and Claims" },
|
|
230
|
-
194: { name: "Grant or Assistance Application" },
|
|
231
|
-
195: { name: "Federal Communications Commission (FCC) License Application" },
|
|
232
|
-
196: { name: "Contractor Cost Data Reporting" },
|
|
233
|
-
197: { name: "Real Estate Title Evidence" },
|
|
234
|
-
198: { name: "Loan Verification Information" },
|
|
235
|
-
199: { name: "Real Estate Settlement Information" },
|
|
236
|
-
200: { name: "Mortgage Credit Report" },
|
|
237
|
-
201: { name: "Residential Loan Application" },
|
|
238
|
-
202: { name: "Secondary Mortgage Market Loan Delivery" },
|
|
239
|
-
203: { name: "Secondary Mortgage Market Investor Report" },
|
|
240
|
-
204: { name: "Motor Carrier Load Tender" },
|
|
241
|
-
205: { name: "Mortgage Note" },
|
|
242
|
-
206: { name: "Real Estate Inspection" },
|
|
243
|
-
210: { name: "Motor Carrier Freight Details and Invoice" },
|
|
244
|
-
211: { name: "Motor Carrier Bill of Lading", edifactId: "IFTMCE" },
|
|
245
|
-
212: { name: "Motor Carrier Delivery Trailer Manifest" },
|
|
246
|
-
213: { name: "Motor Carrier Shipment Status Inquiry" },
|
|
247
|
-
214: { name: "Transportation Carrier Shipment Status Message" },
|
|
248
|
-
215: { name: "Motor Carrier Pick-up Manifest" },
|
|
249
|
-
216: { name: "Motor Carrier Shipment Pick-up Notification" },
|
|
250
|
-
217: { name: "Motor Carrier Loading and Route Guide" },
|
|
251
|
-
218: { name: "Motor Carrier Tariff Information" },
|
|
252
|
-
219: { name: "Logistics Service Request" },
|
|
253
|
-
220: { name: "Logistics Service Response" },
|
|
254
|
-
222: { name: "Cartage Work Assignment" },
|
|
255
|
-
223: { name: "Consolidators Freight Bill and Invoice" },
|
|
256
|
-
224: { name: "Motor Carrier Summary Freight Bill Manifest" },
|
|
257
|
-
225: { name: "Response to a Cartage Work Assignment" },
|
|
258
|
-
240: { name: "Motor Carrier Package Status" },
|
|
259
|
-
242: { name: "Data Status Tracking" },
|
|
260
|
-
244: { name: "Product Source Information" },
|
|
261
|
-
248: { name: "Account Assignment/Inquiry and Service/Status" },
|
|
262
|
-
249: { name: "Animal Toxicological Data" },
|
|
263
|
-
250: { name: "Purchase Order Shipment Management Document" },
|
|
264
|
-
251: { name: "Pricing Support" },
|
|
265
|
-
252: { name: "Insurance Producer Administration" },
|
|
266
|
-
255: { name: "Underwriting Information Services" },
|
|
267
|
-
256: { name: "Periodic Compensation" },
|
|
268
|
-
260: { name: "Application for Mortgage Insurance Benefits" },
|
|
269
|
-
261: { name: "Real Estate Information Request" },
|
|
270
|
-
262: { name: "Real Estate Information Report" },
|
|
271
|
-
263: { name: "Residential Mortgage Insurance Application Response" },
|
|
272
|
-
264: { name: "Mortgage Loan Default Status" },
|
|
273
|
-
265: { name: "Real Estate Title Insurance Services Order" },
|
|
274
|
-
266: { name: "Mortgage or Property Record Change Notification" },
|
|
275
|
-
267: { name: "Individual Life, Annuity and Disability Application" },
|
|
276
|
-
268: { name: "Annuity Activity" },
|
|
277
|
-
270: { name: "Eligibility, Coverage or Benefit Inquiry" },
|
|
278
|
-
271: { name: "Eligibility, Coverage or Benefit Information" },
|
|
279
|
-
272: { name: "Property and Casualty Loss Notification" },
|
|
280
|
-
273: { name: "Insurance/Annuity Application Status" },
|
|
281
|
-
274: { name: "Health Care Provider Information" },
|
|
282
|
-
275: { name: "Patient Information" },
|
|
283
|
-
276: { name: "Health Care Claim Status Request" },
|
|
284
|
-
277: { name: "Health Care Claim Status Notification" },
|
|
285
|
-
278: { name: "Health Care Services Insurance/Benefit Review Information" },
|
|
286
|
-
280: { name: "Voter Registration Information" },
|
|
287
|
-
285: { name: "Commercial Vehicle Safety and Credentials Information Exchange" },
|
|
288
|
-
286: { name: "Commercial Vehicle Credentials" },
|
|
289
|
-
288: { name: "Wage Determination" },
|
|
290
|
-
290: { name: "Cooperative Advertising Agreements" },
|
|
291
|
-
300: { name: "Reservation (Booking Request) (Ocean)" },
|
|
292
|
-
301: { name: "Confirmation (Ocean)", edifactId: "IFTMBC" },
|
|
293
|
-
303: { name: "Booking Cancellation (Ocean)" },
|
|
294
|
-
304: { name: "Shipping Instructions" },
|
|
295
|
-
309: { name: "U.S. Customs Manifest" },
|
|
296
|
-
310: { name: "Freight Receipt and Invoice (Ocean)" },
|
|
297
|
-
311: { name: "Canadian Customs Information" },
|
|
298
|
-
312: { name: "Arrival Notice (Ocean)" },
|
|
299
|
-
313: { name: "Shipment Status Inquiry (Ocean)" },
|
|
300
|
-
315: { name: "Status Details (Ocean)" },
|
|
301
|
-
317: { name: "Delivery/Pickup Order" },
|
|
302
|
-
319: { name: "Terminal Information" },
|
|
303
|
-
322: { name: "Terminal Operations and Intermodal Ramp Activity" },
|
|
304
|
-
323: { name: "Vessel Schedule and Itinerary (Ocean)" },
|
|
305
|
-
324: { name: "Vessel Stow Plan (Ocean)" },
|
|
306
|
-
325: { name: "Consolidation of Goods In Container" },
|
|
307
|
-
326: { name: "Consignment Summary List" },
|
|
308
|
-
350: { name: "U.S. Customs Status Information" },
|
|
309
|
-
352: { name: "U.S. Customs Carrier General Order Status" },
|
|
310
|
-
353: { name: "U.S. Customs Events Advisory Details" },
|
|
311
|
-
354: { name: "U.S. Customs Automated Manifest Archive Status" },
|
|
312
|
-
355: { name: "U.S. Customs Acceptance/Rejection" },
|
|
313
|
-
356: { name: "U.S. Customs Permit to Transfer Request" },
|
|
314
|
-
357: { name: "U.S. Customs In-Bond Information" },
|
|
315
|
-
358: { name: "U.S. Customs Consist Information" },
|
|
316
|
-
361: { name: "Carrier Interchange Agreement (Ocean)" },
|
|
317
|
-
362: { name: "Cargo Insurance Advice of Shipment" },
|
|
318
|
-
404: { name: "Rail Carrier Shipment Information" },
|
|
319
|
-
410: { name: "Rail Carrier Freight Details and Invoice" },
|
|
320
|
-
411: { name: "Rail Carrier Freight Details and Invoice Summary" },
|
|
321
|
-
412: { name: "Trailer or Container Repair Billing" },
|
|
322
|
-
414: { name: "Rail Carhire Settlements" },
|
|
323
|
-
417: { name: "Rail Carrier Waybill Interchange" },
|
|
324
|
-
418: { name: "Rail Advance Interchange Consist" },
|
|
325
|
-
419: { name: "Advance Car Disposition" },
|
|
326
|
-
420: { name: "Car Handling Information" },
|
|
327
|
-
421: { name: "Estimated Time of Arrival and Car Scheduling" },
|
|
328
|
-
422: { name: "Shipper's Car Order" },
|
|
329
|
-
423: { name: "Rail Industrial Switch List" },
|
|
330
|
-
424: { name: "Rail Carrier Services Settlement" },
|
|
331
|
-
425: { name: "Rail Waybill Request" },
|
|
332
|
-
426: { name: "Rail Revenue Waybill" },
|
|
333
|
-
427: { name: "Rail Waybill Response" },
|
|
334
|
-
429: { name: "Railroad Retirement Activity" },
|
|
335
|
-
431: { name: "Railroad Station Master File" },
|
|
336
|
-
432: { name: "Rail Deprescription" },
|
|
337
|
-
433: { name: "Railroad Reciprocal Switch File" },
|
|
338
|
-
434: { name: "Railroad Mark Register Update Activity" },
|
|
339
|
-
435: { name: "Standard Transportation Commodity Code (STCC) Master" },
|
|
340
|
-
436: { name: "Locomotive Information" },
|
|
341
|
-
437: { name: "Railroad Junctions and Interchanges Activity" },
|
|
342
|
-
440: { name: "Shipment Weights" },
|
|
343
|
-
451: { name: "Railroad Event Report" },
|
|
344
|
-
452: { name: "Railroad Problem Log Inquiry or Advice" },
|
|
345
|
-
453: { name: "Railroad Service Commitment Advice" },
|
|
346
|
-
455: { name: "Railroad Parameter Trace Registration" },
|
|
347
|
-
456: { name: "Railroad Equipment Inquiry or Advice" },
|
|
348
|
-
460: { name: "Railroad Price Distribution Request or Response" },
|
|
349
|
-
463: { name: "Rail Rate Reply" },
|
|
350
|
-
466: { name: "Rate Request" },
|
|
351
|
-
468: { name: "Rate Docket Journal Log" },
|
|
352
|
-
470: { name: "Railroad Clearance" },
|
|
353
|
-
475: { name: "Rail Route File Maintenance" },
|
|
354
|
-
485: { name: "Ratemaking Action" },
|
|
355
|
-
486: { name: "Rate Docket Expiration" },
|
|
356
|
-
490: { name: "Rate Group Definition" },
|
|
357
|
-
492: { name: "Miscellaneous Rates" },
|
|
358
|
-
494: { name: "Rail Scale Rates" },
|
|
359
|
-
500: { name: "Medical Event Reporting" },
|
|
360
|
-
501: { name: "Vendor Performance Review" },
|
|
361
|
-
503: { name: "Pricing History" },
|
|
362
|
-
504: { name: "Clauses and Provisions" },
|
|
363
|
-
511: { name: "Requisition" },
|
|
364
|
-
517: { name: "Material Obligation Validation" },
|
|
365
|
-
521: { name: "Income or Asset Offset" },
|
|
366
|
-
527: { name: "Material Due-In and Receipt" },
|
|
367
|
-
536: { name: "Logistics Reassignment" },
|
|
368
|
-
540: { name: "Notice of Employment Status" },
|
|
369
|
-
561: { name: "Contract Abstract" },
|
|
370
|
-
567: { name: "Contract Completion Status" },
|
|
371
|
-
568: { name: "Contract Payment Management Report" },
|
|
372
|
-
601: { name: "U.S. Customs Export Shipment Information" },
|
|
373
|
-
602: { name: "Transportation Services Tender" },
|
|
374
|
-
620: { name: "Excavation Communication" },
|
|
375
|
-
625: { name: "Well Information" },
|
|
376
|
-
650: { name: "Maintenance Service Order" },
|
|
377
|
-
715: { name: "Intermodal Group Loading Plan" },
|
|
378
|
-
805: { name: "Contract Pricing Proposal" },
|
|
379
|
-
806: { name: "Project Schedule Reporting" },
|
|
380
|
-
810: { name: "Invoice", edifactId: "INVOIC" },
|
|
381
|
-
811: { name: "Consolidated Service Invoice/Statement" },
|
|
382
|
-
812: { name: "Credit/Debit Adjustment" },
|
|
383
|
-
813: { name: "Electronic Filing of Tax Return Data" },
|
|
384
|
-
814: { name: "General Request, Response or Confirmation" },
|
|
385
|
-
815: { name: "Cryptographic Service Message" },
|
|
386
|
-
816: { name: "Organizational Relationships" },
|
|
387
|
-
818: { name: "Commission Sales Report" },
|
|
388
|
-
819: { name: "Operating Expense Statement" },
|
|
389
|
-
820: { name: "Payment Order/Remittance Advice", edifactId: "REMADV" },
|
|
390
|
-
821: { name: "Financial Information Reporting" },
|
|
391
|
-
822: { name: "Account Analysis" },
|
|
392
|
-
823: { name: "Lockbox" },
|
|
393
|
-
824: { name: "Application Advice", edifactId: "APERAK" },
|
|
394
|
-
826: { name: "Tax Information Exchange" },
|
|
395
|
-
827: { name: "Financial Return Notice" },
|
|
396
|
-
828: { name: "Debit Authorization" },
|
|
397
|
-
829: { name: "Payment Cancellation Request" },
|
|
398
|
-
830: { name: "Planning Schedule with Release Capability", edifactId: "DELFOR" },
|
|
399
|
-
831: { name: "Application Control Totals" },
|
|
400
|
-
832: { name: "Price/Sales Catalog", edifactId: "PRICAT" },
|
|
401
|
-
833: { name: "Mortgage Credit Report Order" },
|
|
402
|
-
834: { name: "Benefit Enrollment and Maintenance" },
|
|
403
|
-
835: { name: "Health Care Claim Payment/Advice" },
|
|
404
|
-
836: { name: "Procurement Notices" },
|
|
405
|
-
837: { name: "Health Care Claim" },
|
|
406
|
-
838: { name: "Trading Partner Profile" },
|
|
407
|
-
839: { name: "Project Cost Reporting" },
|
|
408
|
-
840: { name: "Request for Quotation", edifactId: "REQUOTE" },
|
|
409
|
-
841: { name: "Specifications/Technical Information" },
|
|
410
|
-
842: { name: "Nonconformance Report" },
|
|
411
|
-
843: { name: "Response to Request for Quotation", edifactId: "QUOTES" },
|
|
412
|
-
844: { name: "Product Transfer Account Adjustment", edifactId: "SSDCLM" },
|
|
413
|
-
845: { name: "Price Authorization Acknowledgment/Status", edifactId: "ATHSTS" },
|
|
414
|
-
846: { name: "Inventory Inquiry/Advice", edifactId: "INVRPT" },
|
|
415
|
-
847: { name: "Material Claim" },
|
|
416
|
-
848: { name: "Material Safety Data Sheet" },
|
|
417
|
-
849: { name: "Response to Product Transfer Account Adjustment" },
|
|
418
|
-
850: { name: "Purchase Order", edifactId: "ORDERS" },
|
|
419
|
-
851: { name: "Asset Schedule" },
|
|
420
|
-
852: { name: "Product Activity Data", edifactId: "SLSRPT" },
|
|
421
|
-
853: { name: "Routing and Carrier Instruction" },
|
|
422
|
-
854: { name: "Shipment Delivery Discrepancy Information" },
|
|
423
|
-
855: { name: "Purchase Order Acknowledgment", edifactId: "ORDRSP" },
|
|
424
|
-
856: { name: "Advance Ship Notice/Manifest", edifactId: "DESADV" },
|
|
425
|
-
857: { name: "Shipment and Billing Notice" },
|
|
426
|
-
858: { name: "Shipment Information" },
|
|
427
|
-
859: { name: "Freight Invoice" },
|
|
428
|
-
860: { name: "Purchase Order Change", edifactId: "ORDCHG" },
|
|
429
|
-
861: { name: "Receiving Advice/Acceptance Certificate", edifactId: "RECADV" },
|
|
430
|
-
862: { name: "Shipping Schedule", edifactId: "DELJIT" },
|
|
431
|
-
863: { name: "Report of Test Results" },
|
|
432
|
-
864: { name: "Text Message" },
|
|
433
|
-
865: { name: "Purchase Order Change", edifactId: "ORDRSP" },
|
|
434
|
-
866: { name: "Production Sequence" },
|
|
435
|
-
867: { name: "Product Transfer and Resale Report", edifactId: "SLSRPT" },
|
|
436
|
-
868: { name: "Electronic Form Structure" },
|
|
437
|
-
869: { name: "Order Status Inquiry", edifactId: "ORSSTA" },
|
|
438
|
-
870: { name: "Order Status Report", edifactId: "ORDREP" },
|
|
439
|
-
871: { name: "Component Parts Content" },
|
|
440
|
-
872: { name: "Residential Mortgage Insurance Application" },
|
|
441
|
-
875: { name: "Grocery Products Purchase Order" },
|
|
442
|
-
876: { name: "Grocery Products Purchase Order Change" },
|
|
443
|
-
877: { name: "Manufacturer Coupon Family Code Structure" },
|
|
444
|
-
878: { name: "Product Authorization/De-authorization" },
|
|
445
|
-
879: { name: "Price Information" },
|
|
446
|
-
880: { name: "Grocery Products Invoice" },
|
|
447
|
-
881: { name: "Manufacturer Coupon Redemption Detail" },
|
|
448
|
-
882: { name: "Direct Store Delivery Summary Information" },
|
|
449
|
-
883: { name: "Market Development Fund Allocation" },
|
|
450
|
-
884: { name: "Market Development Fund Settlement" },
|
|
451
|
-
885: { name: "Retail Account Characteristics" },
|
|
452
|
-
886: { name: "Customer Call Reporting" },
|
|
453
|
-
887: { name: "Coupon Notification" },
|
|
454
|
-
888: { name: "Item Maintenance" },
|
|
455
|
-
889: { name: "Promotion Announcement" },
|
|
456
|
-
891: { name: "Deduction Research Report" },
|
|
457
|
-
893: { name: "Item Information Request" },
|
|
458
|
-
894: { name: "Delivery/Return Base Record" },
|
|
459
|
-
895: { name: "Delivery/Return Acknowledgment or Adjustment" },
|
|
460
|
-
896: { name: "Product Dimension Maintenance" },
|
|
461
|
-
920: { name: "Loss or Damage Claim - General Commodities" },
|
|
462
|
-
924: { name: "Loss or Damage Claim - Motor Vehicle" },
|
|
463
|
-
925: { name: "Claim Tracer" },
|
|
464
|
-
926: { name: "Claim Status Report and Tracer Reply" },
|
|
465
|
-
928: { name: "Automotive Inspection Detail" },
|
|
466
|
-
940: { name: "Warehouse Shipping Order" },
|
|
467
|
-
943: { name: "Warehouse Stock Transfer Shipment Advice" },
|
|
468
|
-
944: { name: "Warehouse Stock Transfer Receipt Advice" },
|
|
469
|
-
945: { name: "Warehouse Shipping Advice" },
|
|
470
|
-
947: { name: "Warehouse Inventory Adjustment Advice" },
|
|
471
|
-
980: { name: "Functional Group Totals" },
|
|
472
|
-
990: { name: "Response to a Load Tender" },
|
|
473
|
-
996: { name: "File Transfer" },
|
|
474
|
-
997: { name: "Functional Acknowledgment", edifactId: "CONTROL" },
|
|
475
|
-
998: { name: "Set Cancellation" },
|
|
476
|
-
999: { name: "Implementation Acknowledgment" }
|
|
477
|
-
});
|
|
478
|
-
function castToNumber() {
|
|
479
|
-
return (target, key) => {
|
|
480
|
-
const internalKey = `_${String(key)}`;
|
|
481
|
-
Object.defineProperties(target, {
|
|
482
|
-
[internalKey]: {
|
|
483
|
-
enumerable: false,
|
|
484
|
-
configurable: true,
|
|
485
|
-
writable: true,
|
|
486
|
-
value: void 0
|
|
487
|
-
},
|
|
488
|
-
[key]: {
|
|
489
|
-
enumerable: true,
|
|
490
|
-
configurable: true,
|
|
491
|
-
get() {
|
|
492
|
-
return this[internalKey];
|
|
493
|
-
},
|
|
494
|
-
set(newValue) {
|
|
495
|
-
this[internalKey] = Number(newValue);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
function debounced(ms) {
|
|
502
|
-
return (target, propertyKey, descriptor) => {
|
|
503
|
-
const originalDescriptorCopy = __spreadValues({}, descriptor);
|
|
504
|
-
originalDescriptorCopy.get = function get() {
|
|
505
|
-
const newDescriptorWithDebounced = __spreadValues({}, originalDescriptorCopy);
|
|
506
|
-
newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
|
|
507
|
-
Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
|
|
508
|
-
return newDescriptorWithDebounced.value;
|
|
509
|
-
};
|
|
510
|
-
originalDescriptorCopy.configurable = true;
|
|
511
|
-
delete originalDescriptorCopy.writable;
|
|
512
|
-
delete originalDescriptorCopy.value;
|
|
513
|
-
return originalDescriptorCopy;
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
function lockedToAnimationFrames(target, propertyKey, descriptor) {
|
|
517
|
-
const originalDescriptorCopy = __spreadValues({}, descriptor);
|
|
518
|
-
descriptor.get = function get() {
|
|
519
|
-
const newDescriptor = __spreadValues({}, originalDescriptorCopy);
|
|
520
|
-
newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
|
|
521
|
-
Object.defineProperty(this, propertyKey, newDescriptor);
|
|
522
|
-
return newDescriptor.value;
|
|
523
|
-
};
|
|
524
|
-
descriptor.configurable = true;
|
|
525
|
-
delete descriptor.writable;
|
|
526
|
-
delete descriptor.value;
|
|
527
|
-
return descriptor;
|
|
528
|
-
}
|
|
529
|
-
function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, descriptor) {
|
|
530
|
-
const updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
|
|
531
|
-
const getter = updatedDescriptor.get;
|
|
532
|
-
const { value } = updatedDescriptor;
|
|
533
|
-
updatedDescriptor.get = function get() {
|
|
534
|
-
const self2 = this;
|
|
535
|
-
const fn = value || getter.call(this);
|
|
536
|
-
const boundFn = fn.bind(this);
|
|
537
|
-
const updatedMetadata = __spreadValues(__spreadValues({}, defaults), metadata);
|
|
538
|
-
for (const prop of Object.keys(defaults)) {
|
|
539
|
-
if (typeof metadata[prop] === "function") {
|
|
540
|
-
Object.defineProperty(boundFn, prop, {
|
|
541
|
-
get() {
|
|
542
|
-
return updatedMetadata[prop](self2);
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
} else {
|
|
546
|
-
boundFn[prop] = updatedMetadata[prop];
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
Object.defineProperty(this, key, {
|
|
550
|
-
writable: true,
|
|
551
|
-
configurable: true,
|
|
552
|
-
enumerable: updatedDescriptor.enumerable,
|
|
553
|
-
value: boundFn
|
|
554
|
-
});
|
|
555
|
-
return boundFn;
|
|
556
|
-
};
|
|
557
|
-
delete updatedDescriptor.value;
|
|
558
|
-
delete updatedDescriptor.writable;
|
|
559
|
-
return updatedDescriptor;
|
|
560
|
-
}
|
|
561
|
-
function tickDelay(target, propertyKey, descriptor) {
|
|
562
|
-
const originalDescriptorCopy = __spreadValues({}, descriptor);
|
|
563
|
-
originalDescriptorCopy.get = function get() {
|
|
564
|
-
const newDescriptor = __spreadValues({}, originalDescriptorCopy);
|
|
565
|
-
const boundFn = originalDescriptorCopy.value.bind(this);
|
|
566
|
-
newDescriptor.value = () => setTimeout(boundFn, 0);
|
|
567
|
-
Object.defineProperty(this, propertyKey, newDescriptor);
|
|
568
|
-
return newDescriptor.value;
|
|
569
|
-
};
|
|
570
|
-
originalDescriptorCopy.configurable = true;
|
|
571
|
-
delete originalDescriptorCopy.writable;
|
|
572
|
-
delete originalDescriptorCopy.value;
|
|
573
|
-
return originalDescriptorCopy;
|
|
574
|
-
}
|
|
575
|
-
function constrain(n, range2) {
|
|
576
|
-
if (!n || n < range2[0]) {
|
|
577
|
-
return range2[0];
|
|
578
|
-
}
|
|
579
|
-
if (n > range2[1]) {
|
|
580
|
-
return range2[1];
|
|
581
|
-
}
|
|
582
|
-
return n;
|
|
583
|
-
}
|
|
584
|
-
function decimalRound(num, decimalPlaces = 0) {
|
|
585
|
-
const integralAndFractionalSplit = String(num).split(".");
|
|
586
|
-
const allDecimalPlaces = integralAndFractionalSplit.length > 1 ? integralAndFractionalSplit[1].length : 0;
|
|
587
|
-
let roundedNum = num;
|
|
588
|
-
for (let i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
|
|
589
|
-
roundedNum = Number(`${Math.round(Number(`${roundedNum}e${i}`))}e-${i}`);
|
|
590
|
-
}
|
|
591
|
-
return roundedNum;
|
|
592
|
-
}
|
|
593
|
-
function toFileSizeString(n, precision = 2) {
|
|
594
|
-
if (n > Number.MAX_SAFE_INTEGER) {
|
|
595
|
-
throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");
|
|
596
|
-
}
|
|
597
|
-
const magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
|
|
598
|
-
const unit = [
|
|
599
|
-
"B",
|
|
600
|
-
"KB",
|
|
601
|
-
"MB",
|
|
602
|
-
"GB",
|
|
603
|
-
"TB",
|
|
604
|
-
"PB"
|
|
605
|
-
][magnitude];
|
|
606
|
-
const decimalPlaces = magnitude ? precision : 0;
|
|
607
|
-
return decimalRound(n / 1024 ** magnitude, decimalPlaces).toFixed(decimalPlaces) + unit;
|
|
608
|
-
}
|
|
609
|
-
function crumblePath(path) {
|
|
610
|
-
return typeof path === "string" ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
|
|
611
|
-
}
|
|
612
|
-
function copyProperty(propName, sourceObject, destObject) {
|
|
613
|
-
Object.defineProperty(destObject, propName, Object.getOwnPropertyDescriptor(sourceObject, propName));
|
|
614
|
-
}
|
|
615
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
616
|
-
var objectTag = "[object Object]";
|
|
617
|
-
function isHostObject(value) {
|
|
618
|
-
var result = false;
|
|
619
|
-
if (value != null && typeof value.toString != "function") {
|
|
620
|
-
try {
|
|
621
|
-
result = !!(value + "");
|
|
622
|
-
} catch (e) {
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
return result;
|
|
626
|
-
}
|
|
627
|
-
function overArg(func, transform) {
|
|
628
|
-
return function(arg) {
|
|
629
|
-
return func(transform(arg));
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
var funcProto = Function.prototype, objectProto = Object.prototype;
|
|
633
|
-
var funcToString = funcProto.toString;
|
|
634
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
635
|
-
var objectCtorString = funcToString.call(Object);
|
|
636
|
-
var objectToString = objectProto.toString;
|
|
637
|
-
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
638
|
-
function isObjectLike(value) {
|
|
639
|
-
return !!value && typeof value == "object";
|
|
640
|
-
}
|
|
641
|
-
function isPlainObject(value) {
|
|
642
|
-
if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
|
|
643
|
-
return false;
|
|
644
|
-
}
|
|
645
|
-
var proto = getPrototype(value);
|
|
646
|
-
if (proto === null) {
|
|
647
|
-
return true;
|
|
648
|
-
}
|
|
649
|
-
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
650
|
-
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
651
|
-
}
|
|
652
|
-
var lodash_isplainobject = isPlainObject;
|
|
653
|
-
function deepFreeze(obj) {
|
|
654
|
-
Object.freeze(obj);
|
|
655
|
-
for (const key of Object.keys(obj)) {
|
|
656
|
-
const val = obj[key];
|
|
657
|
-
if (lodash_isplainobject(val) || Array.isArray(val)) {
|
|
658
|
-
deepFreeze(val);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
var DiffChange;
|
|
663
|
-
(function(DiffChange2) {
|
|
664
|
-
DiffChange2[DiffChange2["ADDITION"] = 0] = "ADDITION";
|
|
665
|
-
DiffChange2[DiffChange2["DELETION"] = 1] = "DELETION";
|
|
666
|
-
DiffChange2[DiffChange2["ALTERATION"] = 2] = "ALTERATION";
|
|
667
|
-
})(DiffChange || (DiffChange = {}));
|
|
668
|
-
function diff(o1, o2, parentPath = []) {
|
|
669
|
-
let d = [];
|
|
670
|
-
for (const key of new Set([...Object.keys(o1), ...Object.keys(o2)])) {
|
|
671
|
-
const o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
|
|
672
|
-
const o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
|
|
673
|
-
if (o1HasKey && !o2HasKey) {
|
|
674
|
-
d.push({
|
|
675
|
-
type: 1,
|
|
676
|
-
key,
|
|
677
|
-
parentPath,
|
|
678
|
-
objects: [o1, o2]
|
|
679
|
-
});
|
|
680
|
-
} else if (!o1HasKey && o2HasKey) {
|
|
681
|
-
d.push({
|
|
682
|
-
type: 0,
|
|
683
|
-
key,
|
|
684
|
-
parentPath,
|
|
685
|
-
objects: [o1, o2]
|
|
686
|
-
});
|
|
687
|
-
} else if (lodash_isplainobject(o1[key]) && lodash_isplainobject(o2[key]) || Array.isArray(o1[key]) && Array.isArray(o2[key])) {
|
|
688
|
-
d = d.concat(diff(o1[key], o2[key], [...parentPath, key]));
|
|
689
|
-
} else if (o1[key] !== o2[key]) {
|
|
690
|
-
d.push({
|
|
691
|
-
type: 2,
|
|
692
|
-
key,
|
|
693
|
-
parentPath,
|
|
694
|
-
objects: [o1, o2]
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
return d;
|
|
699
|
-
}
|
|
700
|
-
function forEachEntryDeep(object, fn) {
|
|
701
|
-
for (const key of Object.keys(object)) {
|
|
702
|
-
const value = object[key];
|
|
703
|
-
if (lodash_isplainobject(value) || Array.isArray(value)) {
|
|
704
|
-
forEachEntryDeep(value, fn);
|
|
705
|
-
} else {
|
|
706
|
-
fn(key, value, object);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
function forEachNestedObject(object, fn, path = []) {
|
|
711
|
-
fn(path, object);
|
|
712
|
-
for (const key of Object.keys(object)) {
|
|
713
|
-
const value = object[key];
|
|
714
|
-
if (lodash_isplainobject(value) || Array.isArray(value)) {
|
|
715
|
-
const newPath = path.concat(key);
|
|
716
|
-
forEachNestedObject(value, fn, newPath);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
function isNil$1(value) {
|
|
721
|
-
return value == null;
|
|
722
|
-
}
|
|
723
|
-
var lodash_isnil = isNil$1;
|
|
724
|
-
var isNilImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
|
|
725
|
-
__proto__: null,
|
|
726
|
-
[Symbol.toStringTag]: "Module",
|
|
727
|
-
"default": lodash_isnil
|
|
728
|
-
}, [lodash_isnil]));
|
|
729
|
-
var lodash_isempty$1 = { exports: {} };
|
|
730
|
-
(function(module, exports) {
|
|
731
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
732
|
-
var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", objectTag2 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
|
|
733
|
-
var dataViewTag = "[object DataView]";
|
|
734
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
735
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
736
|
-
var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
737
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
738
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
|
739
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
740
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
741
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
742
|
-
function getValue(object, key) {
|
|
743
|
-
return object == null ? void 0 : object[key];
|
|
744
|
-
}
|
|
745
|
-
function isHostObject2(value) {
|
|
746
|
-
var result = false;
|
|
747
|
-
if (value != null && typeof value.toString != "function") {
|
|
748
|
-
try {
|
|
749
|
-
result = !!(value + "");
|
|
750
|
-
} catch (e) {
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
return result;
|
|
754
|
-
}
|
|
755
|
-
function overArg2(func, transform) {
|
|
756
|
-
return function(arg) {
|
|
757
|
-
return func(transform(arg));
|
|
758
|
-
};
|
|
759
|
-
}
|
|
760
|
-
var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
|
|
761
|
-
var coreJsData = root["__core-js_shared__"];
|
|
762
|
-
var maskSrcKey = function() {
|
|
763
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
764
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
765
|
-
}();
|
|
766
|
-
var funcToString2 = funcProto2.toString;
|
|
767
|
-
var hasOwnProperty2 = objectProto2.hasOwnProperty;
|
|
768
|
-
var objectToString2 = objectProto2.toString;
|
|
769
|
-
var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
770
|
-
var Buffer2 = moduleExports ? root.Buffer : void 0, propertyIsEnumerable = objectProto2.propertyIsEnumerable;
|
|
771
|
-
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg2(Object.keys, Object);
|
|
772
|
-
var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap");
|
|
773
|
-
var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
|
|
774
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
|
|
775
|
-
function baseGetTag(value) {
|
|
776
|
-
return objectToString2.call(value);
|
|
777
|
-
}
|
|
778
|
-
function baseIsNative(value) {
|
|
779
|
-
if (!isObject(value) || isMasked(value)) {
|
|
780
|
-
return false;
|
|
781
|
-
}
|
|
782
|
-
var pattern = isFunction(value) || isHostObject2(value) ? reIsNative : reIsHostCtor;
|
|
783
|
-
return pattern.test(toSource(value));
|
|
784
|
-
}
|
|
785
|
-
function getNative(object, key) {
|
|
786
|
-
var value = getValue(object, key);
|
|
787
|
-
return baseIsNative(value) ? value : void 0;
|
|
788
|
-
}
|
|
789
|
-
var getTag = baseGetTag;
|
|
790
|
-
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
|
791
|
-
getTag = function(value) {
|
|
792
|
-
var result = objectToString2.call(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
|
|
793
|
-
if (ctorString) {
|
|
794
|
-
switch (ctorString) {
|
|
795
|
-
case dataViewCtorString:
|
|
796
|
-
return dataViewTag;
|
|
797
|
-
case mapCtorString:
|
|
798
|
-
return mapTag;
|
|
799
|
-
case promiseCtorString:
|
|
800
|
-
return promiseTag;
|
|
801
|
-
case setCtorString:
|
|
802
|
-
return setTag;
|
|
803
|
-
case weakMapCtorString:
|
|
804
|
-
return weakMapTag;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
return result;
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
function isMasked(func) {
|
|
811
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
812
|
-
}
|
|
813
|
-
function isPrototype(value) {
|
|
814
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
|
|
815
|
-
return value === proto;
|
|
816
|
-
}
|
|
817
|
-
function toSource(func) {
|
|
818
|
-
if (func != null) {
|
|
819
|
-
try {
|
|
820
|
-
return funcToString2.call(func);
|
|
821
|
-
} catch (e) {
|
|
822
|
-
}
|
|
823
|
-
try {
|
|
824
|
-
return func + "";
|
|
825
|
-
} catch (e) {
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
return "";
|
|
829
|
-
}
|
|
830
|
-
function isArguments(value) {
|
|
831
|
-
return isArrayLikeObject(value) && hasOwnProperty2.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString2.call(value) == argsTag);
|
|
832
|
-
}
|
|
833
|
-
var isArray = Array.isArray;
|
|
834
|
-
function isArrayLike(value) {
|
|
835
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
836
|
-
}
|
|
837
|
-
function isArrayLikeObject(value) {
|
|
838
|
-
return isObjectLike2(value) && isArrayLike(value);
|
|
839
|
-
}
|
|
840
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
841
|
-
function isEmpty2(value) {
|
|
842
|
-
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isArguments(value))) {
|
|
843
|
-
return !value.length;
|
|
844
|
-
}
|
|
845
|
-
var tag = getTag(value);
|
|
846
|
-
if (tag == mapTag || tag == setTag) {
|
|
847
|
-
return !value.size;
|
|
848
|
-
}
|
|
849
|
-
if (nonEnumShadows || isPrototype(value)) {
|
|
850
|
-
return !nativeKeys(value).length;
|
|
851
|
-
}
|
|
852
|
-
for (var key in value) {
|
|
853
|
-
if (hasOwnProperty2.call(value, key)) {
|
|
854
|
-
return false;
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
return true;
|
|
858
|
-
}
|
|
859
|
-
function isFunction(value) {
|
|
860
|
-
var tag = isObject(value) ? objectToString2.call(value) : "";
|
|
861
|
-
return tag == funcTag || tag == genTag;
|
|
862
|
-
}
|
|
863
|
-
function isLength(value) {
|
|
864
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
865
|
-
}
|
|
866
|
-
function isObject(value) {
|
|
867
|
-
var type = typeof value;
|
|
868
|
-
return !!value && (type == "object" || type == "function");
|
|
869
|
-
}
|
|
870
|
-
function isObjectLike2(value) {
|
|
871
|
-
return !!value && typeof value == "object";
|
|
872
|
-
}
|
|
873
|
-
function stubFalse() {
|
|
874
|
-
return false;
|
|
875
|
-
}
|
|
876
|
-
module.exports = isEmpty2;
|
|
877
|
-
})(lodash_isempty$1, lodash_isempty$1.exports);
|
|
878
|
-
var lodash_isempty = lodash_isempty$1.exports;
|
|
879
|
-
var isEmptyImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
|
|
880
|
-
__proto__: null,
|
|
881
|
-
[Symbol.toStringTag]: "Module",
|
|
882
|
-
"default": lodash_isempty
|
|
883
|
-
}, [lodash_isempty$1.exports]));
|
|
884
|
-
const isNil = lodash_isnil || isNilImport;
|
|
885
|
-
const isEmpty$1 = lodash_isempty || isEmptyImport;
|
|
886
|
-
function getPath(object, path, defaultValue, allOptional = false) {
|
|
887
|
-
if (isEmpty$1(path)) {
|
|
888
|
-
return object;
|
|
889
|
-
}
|
|
890
|
-
let value = object;
|
|
891
|
-
for (const crumb of crumblePath(path)) {
|
|
892
|
-
let key = crumb;
|
|
893
|
-
let optional;
|
|
894
|
-
if (typeof crumb === "string") {
|
|
895
|
-
[
|
|
896
|
-
,
|
|
897
|
-
key,
|
|
898
|
-
optional
|
|
899
|
-
] = /^([^?]+)(\?)?$/.exec(crumb);
|
|
900
|
-
}
|
|
901
|
-
value = value[key];
|
|
902
|
-
if (isNil(value) && (optional || allOptional)) {
|
|
903
|
-
return defaultValue;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
return isNil(value) ? defaultValue : value;
|
|
907
|
-
}
|
|
908
|
-
function omit(obj, ...keys) {
|
|
909
|
-
const keySet = new Set(keys);
|
|
910
|
-
const result = {};
|
|
911
|
-
for (const k of Object.keys(obj)) {
|
|
912
|
-
if (!keySet.has(k)) {
|
|
913
|
-
result[k] = obj[k];
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
return result;
|
|
917
|
-
}
|
|
918
|
-
const isEmpty = lodash_isempty || isEmptyImport;
|
|
919
|
-
function setPath(object, path, newValue) {
|
|
920
|
-
if (typeof object !== "object") {
|
|
921
|
-
throw new Error("object is required");
|
|
922
|
-
}
|
|
923
|
-
if (isEmpty(path)) {
|
|
924
|
-
throw new Error("path is required");
|
|
925
|
-
}
|
|
926
|
-
const crumbs = crumblePath(path);
|
|
927
|
-
const finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
|
|
928
|
-
let current = object;
|
|
929
|
-
for (const crumb of crumbs) {
|
|
930
|
-
current = current[crumb];
|
|
931
|
-
if (typeof current !== "object") {
|
|
932
|
-
throw new Error(`Cannot set value at given path: Path deadends at ${String(crumb)}`);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
current[finalCrumb] = newValue;
|
|
936
|
-
}
|
|
937
|
-
function* traversePath(object, path) {
|
|
938
|
-
yield object;
|
|
939
|
-
let obj = object;
|
|
940
|
-
for (const crumb of crumblePath(path)) {
|
|
941
|
-
obj = obj[crumb];
|
|
942
|
-
yield obj;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
function mergeDeep(...objectsToMerge) {
|
|
946
|
-
const result = {};
|
|
947
|
-
for (const mergee of objectsToMerge) {
|
|
948
|
-
for (const key of Object.keys(mergee)) {
|
|
949
|
-
if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
|
|
950
|
-
result[key] = mergeDeep(result[key], mergee[key]);
|
|
951
|
-
} else if (lodash_isplainobject(mergee[key])) {
|
|
952
|
-
result[key] = mergeDeep({}, mergee[key]);
|
|
953
|
-
} else {
|
|
954
|
-
result[key] = mergee[key];
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
return result;
|
|
959
|
-
}
|
|
960
|
-
function mergePropertiesDeep(...objectsToMerge) {
|
|
961
|
-
const result = {};
|
|
962
|
-
for (const mergee of objectsToMerge) {
|
|
963
|
-
for (const key of Object.keys(mergee)) {
|
|
964
|
-
if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
|
|
965
|
-
result[key] = mergePropertiesDeep(result[key], mergee[key]);
|
|
966
|
-
} else if (lodash_isplainobject(mergee[key])) {
|
|
967
|
-
result[key] = mergePropertiesDeep({}, mergee[key]);
|
|
968
|
-
} else {
|
|
969
|
-
copyProperty(key, mergee, result);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
return result;
|
|
974
|
-
}
|
|
975
|
-
function values(object) {
|
|
976
|
-
const vals = [];
|
|
977
|
-
for (const key of Object.keys(object)) {
|
|
978
|
-
vals.push(object[key]);
|
|
979
|
-
}
|
|
980
|
-
return vals;
|
|
981
|
-
}
|
|
982
|
-
function code(strings, ...interpolations) {
|
|
983
|
-
const s = strings.reduce((a, b, i) => `${a}${i <= interpolations.length ? String(interpolations[i - 1]) : ""}${b}`);
|
|
984
|
-
const leadingWhitespace = Math.min(...s.split(/[\r\n]/).filter((l) => l.trim()).map((l) => /^ */.exec(l)[0].length));
|
|
985
|
-
return s.replace(new RegExp(`^ {${leadingWhitespace}}`, "gm"), "").trim();
|
|
986
|
-
}
|
|
987
|
-
function parseFileSize(fileSize) {
|
|
988
|
-
const unitMatch = /[A-Z]?B$/.exec(fileSize);
|
|
989
|
-
if (!unitMatch) {
|
|
990
|
-
throw new Error(`Input to parseFileSize ("${fileSize}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);
|
|
991
|
-
}
|
|
992
|
-
const [unit] = unitMatch;
|
|
993
|
-
const num = Number(fileSize.replace(unit, ""));
|
|
994
|
-
if (Number.isNaN(num)) {
|
|
995
|
-
throw new Error(`Could not parse a number out of input to parseFileSize ("${fileSize}")`);
|
|
996
|
-
}
|
|
997
|
-
const magnitude = [
|
|
998
|
-
"B",
|
|
999
|
-
"KB",
|
|
1000
|
-
"MB",
|
|
1001
|
-
"GB",
|
|
1002
|
-
"TB",
|
|
1003
|
-
"PB"
|
|
1004
|
-
].indexOf(unit);
|
|
1005
|
-
if (magnitude === -1) {
|
|
1006
|
-
throw new Error("parseFileSize does not support units above PB");
|
|
1007
|
-
}
|
|
1008
|
-
return Math.ceil(num * 1024 ** magnitude);
|
|
1009
|
-
}
|
|
1010
|
-
const REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
|
|
1011
|
-
const REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
|
|
1012
|
-
const SYMBOL_TEMPLATE_SOURCE = Symbol("sps.utils.templateSrc");
|
|
1013
|
-
function template(string) {
|
|
1014
|
-
const fn = (data) => string.replace(REGEX_IF, (match, pathToCheck, content) => getPath(data, pathToCheck.trim()) ? content : "").replace(REGEX_REPLACEMENT, (match, _, pathToInterpolate) => getPath(data, pathToInterpolate.trim(), ""));
|
|
1015
|
-
fn[SYMBOL_TEMPLATE_SOURCE] = string;
|
|
1016
|
-
return fn;
|
|
1017
|
-
}
|
|
1018
|
-
function isTemplate(x) {
|
|
1019
|
-
return typeof x === "string" && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
|
|
1020
|
-
}
|
|
1021
|
-
function isTemplateFn(x) {
|
|
1022
|
-
return typeof x === "function" && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
|
|
1023
|
-
}
|
|
1024
|
-
export { CustomEvent, DiffChange, EDI_DOCUMENT_TYPE, Op, castToNumber, code, constrain, copyProperty, crumblePath, debounce, debounced, decimalRound, deepFreeze, diff, flatten, forEachEntryDeep, forEachNestedObject, getPath, isSubset, isTemplate, isTemplateFn, lockToAnimationFrames, lockedToAnimationFrames, mergeDeep, mergePropertiesDeep, omit, onNextTick, parseFileSize, range, setPath, simpleMetadataDecoratorApplicator, template, tickDelay, toFileSizeString, traversePath, values };
|