@keeex/utils 7.3.0 → 7.4.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.
- package/lib/async/eventqueue.d.ts +60 -0
- package/lib/async/eventqueue.js +129 -0
- package/lib/async/keycache.d.ts +1 -1
- package/lib/async/timecache.d.ts +1 -1
- package/lib/benchmark.d.ts +1 -1
- package/lib/benchmark.js +2 -2
- package/lib/bits/arraybuffer.js +2 -1
- package/lib/bits/triggers/base.d.ts +3 -3
- package/lib/bits/triggers/base.js +3 -3
- package/lib/bits/triggers/debounce.d.ts +1 -1
- package/lib/bits/triggers/grenade.d.ts +1 -1
- package/lib/bits/triggers/types.d.ts +1 -1
- package/lib/cron.d.ts +2 -2
- package/lib/cron.js +1 -1
- package/lib/marshalling/marshaller.d.ts +1 -1
- package/lib/promise.d.ts +1 -1
- package/lib/triggers.d.ts +4 -4
- package/lib/types/array.d.ts +6 -6
- package/lib/types/array.js +3 -3
- package/lib/types/enum.d.ts +3 -3
- package/lib/types/enum.js +2 -2
- package/lib/types/record.d.ts +7 -7
- package/lib/types/record.js +3 -3
- package/lib/types/utils.d.ts +4 -3
- package/lib/types/utils.js +13 -6
- package/package.json +1 -1
- package/web/async/eventqueue.d.ts +60 -0
- package/web/async/eventqueue.js +126 -0
- package/web/async/keycache.d.ts +1 -1
- package/web/async/timecache.d.ts +1 -1
- package/web/benchmark.d.ts +1 -1
- package/web/benchmark.js +2 -2
- package/web/bits/arraybuffer.js +3 -1
- package/web/bits/triggers/base.d.ts +3 -3
- package/web/bits/triggers/base.js +3 -3
- package/web/bits/triggers/debounce.d.ts +1 -1
- package/web/bits/triggers/grenade.d.ts +1 -1
- package/web/bits/triggers/types.d.ts +1 -1
- package/web/cron.d.ts +2 -2
- package/web/marshalling/marshaller.d.ts +1 -1
- package/web/promise.d.ts +1 -1
- package/web/triggers.d.ts +4 -4
- package/web/types/array.d.ts +6 -6
- package/web/types/array.js +3 -3
- package/web/types/enum.d.ts +3 -3
- package/web/types/enum.js +2 -2
- package/web/types/record.d.ts +7 -7
- package/web/types/record.js +3 -3
- package/web/types/utils.d.ts +4 -3
- package/web/types/utils.js +6 -6
package/web/types/utils.js
CHANGED
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
import { isNumber } from "./primitive.js";
|
|
17
|
-
import
|
|
17
|
+
import * as types from "./types.js";
|
|
18
18
|
/** All `ms()` units, extracted from type definition */
|
|
19
19
|
const msBaseUnits = ["Years", "Year", "Yrs", "Yr", "Y", "Weeks", "Week", "W", "Days", "Day", "D", "Hours", "Hour", "Hrs", "Hr", "H", "Minutes", "Minute", "Mins", "Min", "M", "Seconds", "Second", "Secs", "Sec", "s", "Milliseconds", "Millisecond", "Msecs", "Msec", "Ms"];
|
|
20
20
|
/** All `ms()` units, including lowercase and uppercase */
|
|
21
21
|
const msUnitAnyCase = Array.from(new Set([...msBaseUnits, ...msBaseUnits.map(c => c.toUpperCase()), ...msBaseUnits.map(c => c.toLowerCase())]));
|
|
22
|
-
const isMsStrInput = makeTemplatePredicate("${number}");
|
|
23
|
-
const isMsStrUnitPredicate = makeTemplatePredicate("${number}${msUnitAnyCase}", {
|
|
22
|
+
const isMsStrInput = types.makeTemplatePredicate("${number}");
|
|
23
|
+
const isMsStrUnitPredicate = types.makeTemplatePredicate("${number}${msUnitAnyCase}", {
|
|
24
24
|
msUnitAnyCase
|
|
25
25
|
});
|
|
26
|
-
const isMsSpaceUnitPredicate = makeTemplatePredicate("${number} ${msUnitAnyCase}", {
|
|
26
|
+
const isMsSpaceUnitPredicate = types.makeTemplatePredicate("${number} ${msUnitAnyCase}", {
|
|
27
27
|
msUnitAnyCase
|
|
28
28
|
});
|
|
29
29
|
/** Check that the argument match the string portion of `ms()` */
|
|
30
|
-
export const isMsStringValue = makeOrPredicate([isMsStrInput, isMsStrUnitPredicate, isMsSpaceUnitPredicate]);
|
|
30
|
+
export const isMsStringValue = types.makeOrPredicate([isMsStrInput, isMsStrUnitPredicate, isMsSpaceUnitPredicate]);
|
|
31
31
|
/** Check that a value is suitable for input for `ms()` */
|
|
32
|
-
export const isMsInput = makeOrPredicate([isNumber, isMsStringValue]);
|
|
32
|
+
export const isMsInput = types.makeOrPredicate([isNumber, isMsStringValue]);
|