@spscommerce/utils 5.5.0-ie → 5.5.0-ie.2
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/dist/out-tsc/decorators/cast-to-number.js +1 -1
- package/dist/out-tsc/decorators/cast-to-number.js.map +1 -1
- package/dist/out-tsc/number/decimal-round.js +1 -1
- package/dist/out-tsc/number/decimal-round.js.map +1 -1
- package/dist/out-tsc/object/set-path.js +1 -1
- package/dist/out-tsc/object/set-path.js.map +1 -1
- package/dist/out-tsc/string/code.template-tag.js +2 -2
- package/dist/out-tsc/string/code.template-tag.js.map +1 -1
- package/dist/out-tsc/string/parse-file-size.js +2 -2
- package/dist/out-tsc/string/parse-file-size.js.map +1 -1
- package/lib/array/flatten.d.ts +1 -0
- package/lib/array/flatten.spec.d.ts +1 -0
- package/lib/array/index.d.ts +3 -0
- package/lib/array/is-subset.d.ts +4 -0
- package/lib/array/is-subset.spec.d.ts +1 -0
- package/lib/array/range.d.ts +5 -0
- package/lib/array/range.spec.d.ts +1 -0
- package/lib/classes/custom-event.d.ts +4 -0
- package/lib/classes/index.d.ts +1 -0
- package/lib/data/doctypes.d.ts +4 -0
- package/lib/data/index.d.ts +1 -0
- package/lib/decorators/cast-to-number.d.ts +5 -0
- package/lib/decorators/debounced.broken_spec.d.ts +0 -0
- package/lib/decorators/debounced.d.ts +11 -0
- package/lib/decorators/index.d.ts +5 -0
- package/lib/decorators/locked-to-animation-frames.d.ts +4 -0
- package/lib/decorators/locked-to-animation-frames.spec.d.ts +0 -0
- package/lib/decorators/simple-metadata-decorator-applicator.d.ts +11 -0
- package/lib/decorators/tick-delay.d.ts +6 -0
- package/lib/function/debounce.d.ts +9 -0
- package/lib/function/debounce.spec.d.ts +1 -0
- package/lib/function/debounced-function.interface.d.ts +10 -0
- package/lib/function/delayed-function.interface.d.ts +10 -0
- package/lib/function/index.d.ts +6 -0
- package/lib/function/lock-to-animation-frames.d.ts +7 -0
- package/lib/function/lock-to-animation-frames.spec.d.ts +0 -0
- package/lib/function/on-next-tick.d.ts +8 -0
- package/lib/function/on-next-tick.spec.d.ts +1 -0
- package/lib/function/op.d.ts +32 -0
- package/lib/function/op.spec.d.ts +1 -0
- package/lib/index.cjs.js +2437 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.es.js +2399 -0
- package/lib/number/constrain.d.ts +7 -0
- package/lib/number/decimal-round.d.ts +7 -0
- package/lib/number/decimal-round.spec.d.ts +1 -0
- package/lib/number/index.d.ts +3 -0
- package/lib/number/to-file-size-string.d.ts +5 -0
- package/lib/object/copy-property.d.ts +6 -0
- package/lib/object/copy-property.spec.d.ts +1 -0
- package/lib/object/crumble-path.d.ts +6 -0
- package/lib/object/crumble-path.spec.d.ts +1 -0
- package/lib/object/deep-freeze.d.ts +1 -0
- package/lib/object/deep-freeze.spec.d.ts +1 -0
- package/lib/object/diff.d.ts +12 -0
- package/lib/object/diff.spec.d.ts +1 -0
- package/lib/object/for-each-entry-deep.d.ts +4 -0
- package/lib/object/for-each-entry-deep.spec.d.ts +1 -0
- package/lib/object/for-each-nested-object.d.ts +4 -0
- package/lib/object/for-each-nested-object.spec.d.ts +1 -0
- package/lib/object/get-path.d.ts +5 -0
- package/lib/object/get-path.spec.d.ts +1 -0
- package/lib/object/index.d.ts +13 -0
- package/lib/object/merge-deep.d.ts +4 -0
- package/lib/object/merge-deep.spec.d.ts +1 -0
- package/lib/object/merge-properties-deep.d.ts +4 -0
- package/lib/object/merge-properties-deep.spec.d.ts +1 -0
- package/lib/object/omit.d.ts +1 -0
- package/lib/object/omit.spec.d.ts +1 -0
- package/lib/object/set-path.d.ts +2 -0
- package/lib/object/set-path.spec.d.ts +1 -0
- package/lib/object/traverse-path.d.ts +2 -0
- package/lib/object/values.d.ts +2 -0
- package/lib/object/values.spec.d.ts +1 -0
- package/lib/string/code.template-tag.d.ts +2 -0
- package/lib/string/index.d.ts +3 -0
- package/lib/string/parse-file-size.d.ts +5 -0
- package/lib/string/template.d.ts +15 -0
- package/lib/string/template.spec.d.ts +1 -0
- package/lib/typings.d.ts +1 -0
- package/package.json +1 -1
- package/.pnpm-debug.log +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cast-to-number.js","sourceRoot":"","sources":["../../../src/decorators/cast-to-number.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAI,MAAS,EAAE,GAAY;;QAChC,IAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"cast-to-number.js","sourceRoot":"","sources":["../../../src/decorators/cast-to-number.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAI,MAAS,EAAE,GAAY;;QAChC,IAAM,WAAW,GAAG,MAAI,MAAM,CAAC,GAAG,CAAG,CAAC;QACtC,MAAM,CAAC,gBAAgB,CAAC,MAAM;YAC5B,GAAC,WAAW,IAAG;gBACb,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,SAAS;aACjB;YACD,GAAC,GAAG,IAAG;gBACL,UAAU,EAAE,IAAI;gBAChB,YAAY,EAAE,IAAI;gBAClB,GAAG,EAAH;oBACE,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3B,CAAC;gBACD,GAAG,EAAH,UAAI,QAAyB;oBAC3B,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACvC,CAAC;aACF;gBACD,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -12,7 +12,7 @@ export function decimalRound(num, decimalPlaces) {
|
|
|
12
12
|
: 0;
|
|
13
13
|
var roundedNum = num;
|
|
14
14
|
for (var i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
|
|
15
|
-
roundedNum = Number(
|
|
15
|
+
roundedNum = Number(Math.round(Number(roundedNum + "e" + i)) + "e-" + i);
|
|
16
16
|
}
|
|
17
17
|
return roundedNum;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal-round.js","sourceRoot":"","sources":["../../../src/number/decimal-round.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,aAAiB;IAAjB,8BAAA,EAAA,iBAAiB;IACzD,IAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1D,IAAM,gBAAgB,GAAG,0BAA0B,CAAC,MAAM,GAAG,CAAC;QAC5D,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM;QACtC,CAAC,CAAC,CAAC,CAAC;IAEN,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,gBAAgB,GAAG,CAAC,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7D,UAAU,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"decimal-round.js","sourceRoot":"","sources":["../../../src/number/decimal-round.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,aAAiB;IAAjB,8BAAA,EAAA,iBAAiB;IACzD,IAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1D,IAAM,gBAAgB,GAAG,0BAA0B,CAAC,MAAM,GAAG,CAAC;QAC5D,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,MAAM;QACtC,CAAC,CAAC,CAAC,CAAC;IAEN,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,gBAAgB,GAAG,CAAC,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE;QAC7D,UAAU,GAAG,MAAM,CAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAI,UAAU,SAAI,CAAG,CAAC,CAAC,UAAK,CAAG,CAAC,CAAC;KAC1E;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -29,7 +29,7 @@ export function setPath(object, path, newValue) {
|
|
|
29
29
|
var crumb = crumbs_1_1.value;
|
|
30
30
|
current = current[crumb];
|
|
31
31
|
if (typeof current !== "object") {
|
|
32
|
-
throw new Error("Cannot set value at given path: Path deadends at "
|
|
32
|
+
throw new Error("Cannot set value at given path: Path deadends at " + String(crumb));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-path.js","sourceRoot":"","sources":["../../../src/object/set-path.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,IAAM,OAAO,GAAI,aAAqB,CAAC,OAAO,IAAI,aAAa,CAAC;AAEhE,2CAA2C;AAC3C,MAAM,UAAU,OAAO,CAAC,MAAW,EAAE,IAAiC,EAAE,QAAa;;IACnF,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACvC;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IAED,IAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,IAAI,OAAO,GAAG,MAAM,CAAC;;QACrB,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE;YAAvB,IAAM,KAAK,mBAAA;YACd,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;gBAC/B,MAAM,IAAI,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"set-path.js","sourceRoot":"","sources":["../../../src/object/set-path.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,IAAM,OAAO,GAAI,aAAqB,CAAC,OAAO,IAAI,aAAa,CAAC;AAEhE,2CAA2C;AAC3C,MAAM,UAAU,OAAO,CAAC,MAAW,EAAE,IAAiC,EAAE,QAAa;;IACnF,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACvC;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IAED,IAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,IAAI,OAAO,GAAG,MAAM,CAAC;;QACrB,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE;YAAvB,IAAM,KAAK,mBAAA;YACd,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;gBAC/B,MAAM,IAAI,KAAK,CAAC,sDAAoD,MAAM,CAAC,KAAK,CAAG,CAAC,CAAC;aACtF;SACF;;;;;;;;;IAED,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;AACjC,CAAC"}
|
|
@@ -29,10 +29,10 @@ export function code(strings) {
|
|
|
29
29
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
30
30
|
interpolations[_i - 1] = arguments[_i];
|
|
31
31
|
}
|
|
32
|
-
var s = strings.reduce(function (a, b, i) { return ""
|
|
32
|
+
var s = strings.reduce(function (a, b, i) { return "" + a + (i <= interpolations.length ? String(interpolations[i - 1]) : "") + b; });
|
|
33
33
|
var leadingWhitespace = Math.min.apply(Math, __spreadArray([], __read(s.split(/[\r\n]/)
|
|
34
34
|
.filter(function (l) { return l.trim(); })
|
|
35
35
|
.map(function (l) { return (/^ */.exec(l))[0].length; })), false));
|
|
36
|
-
return s.replace(new RegExp("^ {"
|
|
36
|
+
return s.replace(new RegExp("^ {" + leadingWhitespace + "}", "gm"), "").trim();
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=code.template-tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.template-tag.js","sourceRoot":"","sources":["../../../src/string/code.template-tag.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2FAA2F;AAC3F,MAAM,UAAU,IAAI,CAAC,OAA6B;IAAE,wBAA4B;SAA5B,UAA4B,EAA5B,qBAA4B,EAA5B,IAA4B;QAA5B,uCAA4B;;IAC9E,IAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAK,OAAA,
|
|
1
|
+
{"version":3,"file":"code.template-tag.js","sourceRoot":"","sources":["../../../src/string/code.template-tag.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2FAA2F;AAC3F,MAAM,UAAU,IAAI,CAAC,OAA6B;IAAE,wBAA4B;SAA5B,UAA4B,EAA5B,qBAA4B,EAA5B,IAA4B;QAA5B,uCAA4B;;IAC9E,IAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAK,OAAA,KAAG,CAAC,IAAG,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAG,CAAG,EAA5E,CAA4E,CAAC,CAAC;IACpH,IAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,OAAR,IAAI,2BACzB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;SACjB,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,IAAI,EAAE,EAAR,CAAQ,CAAC;SACvB,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAzB,CAAyB,CAAC,UACzC,CAAC;IACF,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,QAAM,iBAAiB,MAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -21,13 +21,13 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
21
21
|
export function parseFileSize(fileSize) {
|
|
22
22
|
var unitMatch = /[A-Z]?B$/.exec(fileSize);
|
|
23
23
|
if (!unitMatch) {
|
|
24
|
-
throw new Error("Input to parseFileSize (\""
|
|
24
|
+
throw new Error("Input to parseFileSize (\"" + fileSize + "\") doesn't seem like a file size; "
|
|
25
25
|
+ "cannot identify a unit (e.g. KB, GB)");
|
|
26
26
|
}
|
|
27
27
|
var _a = __read(unitMatch, 1), unit = _a[0];
|
|
28
28
|
var num = Number(fileSize.replace(unit, ""));
|
|
29
29
|
if (Number.isNaN(num)) {
|
|
30
|
-
throw new Error("Could not parse a number out of input to parseFileSize (\""
|
|
30
|
+
throw new Error("Could not parse a number out of input to parseFileSize (\"" + fileSize + "\")");
|
|
31
31
|
}
|
|
32
32
|
var magnitude = ["B",
|
|
33
33
|
"KB",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-file-size.js","sourceRoot":"","sources":["../../../src/string/parse-file-size.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,IAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CACb,
|
|
1
|
+
{"version":3,"file":"parse-file-size.js","sourceRoot":"","sources":["../../../src/string/parse-file-size.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,IAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CACb,+BAA4B,QAAQ,wCAAoC;cAChE,sCAAsC,CAC/C,CAAC;KACH;IAEK,IAAA,KAAA,OAAS,SAAS,IAAA,EAAjB,IAAI,QAAa,CAAC;IACzB,IAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,+DAA4D,QAAQ,QAAI,CAAC,CAAC;KAC3F;IAED,IAAM,SAAS,GAAG,CAAC,GAAG;QACpB,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAClE;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAA,IAAI,EAAI,SAAS,CAAA,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function flatten(arg: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./custom-event";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./doctypes";
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator that applies `debounce`
|
|
3
|
+
*/
|
|
4
|
+
export declare function debounced(ms: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {
|
|
5
|
+
configurable?: boolean;
|
|
6
|
+
enumerable?: boolean;
|
|
7
|
+
value?: any;
|
|
8
|
+
writable?: boolean;
|
|
9
|
+
get?(): any;
|
|
10
|
+
set?(v: any): void;
|
|
11
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare type MetadataProperty<T, K = any> = T | ((classInstance: K) => T);
|
|
2
|
+
export declare type MetadataObject<K> = Record<string, MetadataProperty<any, K>>;
|
|
3
|
+
/**
|
|
4
|
+
* This would be simpler to understand as a factory that returns a decorator function,
|
|
5
|
+
* but TypeScript AoT compliation doesn't allow that. This lets you create a decorator
|
|
6
|
+
* that takes in a metadata object as an argument and assigns its values along with
|
|
7
|
+
* default values to the decorated method. The decorator will look like a standard
|
|
8
|
+
* decorator but calling this method and returning the result is the only thing it
|
|
9
|
+
* needs to do.
|
|
10
|
+
*/
|
|
11
|
+
export declare function simpleMetadataDecoratorApplicator<T extends MetadataObject<K>, K>(metadata: Partial<T>, defaults: T, target: any, key: PropertyKey, descriptor: TypedPropertyDescriptor<K>): TypedPropertyDescriptor<K>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface FunctionPropertyDescriptor extends PropertyDescriptor {
|
|
2
|
+
value: (...args: unknown[]) => unknown;
|
|
3
|
+
}
|
|
4
|
+
/** Method decorator that configures the method to always run the tick after it's invoked */
|
|
5
|
+
export declare function tickDelay(target: any, propertyKey: string, descriptor: FunctionPropertyDescriptor): FunctionPropertyDescriptor;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Eventually } from "../typings";
|
|
2
|
+
import type { DelayedFunction } from "./delayed-function.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Takes in a function and returns a new function that debounces it.
|
|
5
|
+
* The returned function returns an observable that can be subscribed to
|
|
6
|
+
* if you need to have something happen when the debounced function
|
|
7
|
+
* finally gets called and returns a value.
|
|
8
|
+
*/
|
|
9
|
+
export declare function debounce<T>(functionToDebounce: (...args: any[]) => Eventually<T>, milliseconds: number, thisArg?: any): DelayedFunction<Promise<T>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DelayedFunction } from "./delayed-function.interface";
|
|
2
|
+
/** docs:ignore */
|
|
3
|
+
export interface DebouncedFunction<T> extends DelayedFunction<Promise<T>> {
|
|
4
|
+
(...args: any[]): Promise<T>;
|
|
5
|
+
_promise?: Promise<T>;
|
|
6
|
+
_promiseCallbacks?: {
|
|
7
|
+
resolve: any;
|
|
8
|
+
reject: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DelayedFunction } from "./delayed-function.interface";
|
|
2
|
+
/**
|
|
3
|
+
* Return a new function to replace the passed in one which ensures that
|
|
4
|
+
* the given function will run only in `requestAnimationFrame()` and at
|
|
5
|
+
* most once per frame.
|
|
6
|
+
*/
|
|
7
|
+
export declare function lockToAnimationFrames(functionToLock: () => any, thisArg?: any): DelayedFunction<any>;
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enqueues the given function to run on the next "tick" of the JS event
|
|
3
|
+
* loop cycle. If you ever encounter the "value changed after it was
|
|
4
|
+
* checked" error in Angular when trying to assign a value of a
|
|
5
|
+
* component class, performing that assignment on the next tick, i.e. when
|
|
6
|
+
* all of Angular's current cycle is finished, will resolve that error.
|
|
7
|
+
*/
|
|
8
|
+
export declare function onNextTick(fn: (...args: unknown[]) => unknown, thisArg?: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Functions for various operators, most useful in combination
|
|
3
|
+
* with functional programming tools like map, filter, and reduce.
|
|
4
|
+
*/
|
|
5
|
+
export declare const Op: {
|
|
6
|
+
add: (a: any, b: any) => any;
|
|
7
|
+
and: (a: any, b: any) => any;
|
|
8
|
+
band: (a: any, b: any) => number;
|
|
9
|
+
bor: (a: any, b: any) => number;
|
|
10
|
+
bxor: (a: any, b: any) => number;
|
|
11
|
+
bnot: (a: any) => number;
|
|
12
|
+
decr: (a: number) => number;
|
|
13
|
+
div: (a: number, b: number) => number;
|
|
14
|
+
eq: (a: any, b: any) => boolean;
|
|
15
|
+
exp: (a: number, b: number) => number;
|
|
16
|
+
gt: (a: any, b: any) => boolean;
|
|
17
|
+
gte: (a: any, b: any) => boolean;
|
|
18
|
+
incr: (a: number) => number;
|
|
19
|
+
lshift: (a: any, b: any) => number;
|
|
20
|
+
lt: (a: any, b: any) => boolean;
|
|
21
|
+
lte: (a: any, b: any) => boolean;
|
|
22
|
+
mul: (a: number, b: number) => number;
|
|
23
|
+
neg: (a: number) => number;
|
|
24
|
+
neq: (a: any, b: any) => boolean;
|
|
25
|
+
not: (a: any) => boolean;
|
|
26
|
+
or: (a: any, b: any) => any;
|
|
27
|
+
rem: (a: number, b: number) => number;
|
|
28
|
+
rshift: (a: any, b: any) => number;
|
|
29
|
+
rshift_zf: (a: any, b: any) => number;
|
|
30
|
+
sub: (a: number, b: number) => number;
|
|
31
|
+
xor: (a: any, b: any) => boolean;
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|