@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.
Files changed (50) hide show
  1. package/lib/async/eventqueue.d.ts +60 -0
  2. package/lib/async/eventqueue.js +129 -0
  3. package/lib/async/keycache.d.ts +1 -1
  4. package/lib/async/timecache.d.ts +1 -1
  5. package/lib/benchmark.d.ts +1 -1
  6. package/lib/benchmark.js +2 -2
  7. package/lib/bits/arraybuffer.js +2 -1
  8. package/lib/bits/triggers/base.d.ts +3 -3
  9. package/lib/bits/triggers/base.js +3 -3
  10. package/lib/bits/triggers/debounce.d.ts +1 -1
  11. package/lib/bits/triggers/grenade.d.ts +1 -1
  12. package/lib/bits/triggers/types.d.ts +1 -1
  13. package/lib/cron.d.ts +2 -2
  14. package/lib/cron.js +1 -1
  15. package/lib/marshalling/marshaller.d.ts +1 -1
  16. package/lib/promise.d.ts +1 -1
  17. package/lib/triggers.d.ts +4 -4
  18. package/lib/types/array.d.ts +6 -6
  19. package/lib/types/array.js +3 -3
  20. package/lib/types/enum.d.ts +3 -3
  21. package/lib/types/enum.js +2 -2
  22. package/lib/types/record.d.ts +7 -7
  23. package/lib/types/record.js +3 -3
  24. package/lib/types/utils.d.ts +4 -3
  25. package/lib/types/utils.js +13 -6
  26. package/package.json +1 -1
  27. package/web/async/eventqueue.d.ts +60 -0
  28. package/web/async/eventqueue.js +126 -0
  29. package/web/async/keycache.d.ts +1 -1
  30. package/web/async/timecache.d.ts +1 -1
  31. package/web/benchmark.d.ts +1 -1
  32. package/web/benchmark.js +2 -2
  33. package/web/bits/arraybuffer.js +3 -1
  34. package/web/bits/triggers/base.d.ts +3 -3
  35. package/web/bits/triggers/base.js +3 -3
  36. package/web/bits/triggers/debounce.d.ts +1 -1
  37. package/web/bits/triggers/grenade.d.ts +1 -1
  38. package/web/bits/triggers/types.d.ts +1 -1
  39. package/web/cron.d.ts +2 -2
  40. package/web/marshalling/marshaller.d.ts +1 -1
  41. package/web/promise.d.ts +1 -1
  42. package/web/triggers.d.ts +4 -4
  43. package/web/types/array.d.ts +6 -6
  44. package/web/types/array.js +3 -3
  45. package/web/types/enum.d.ts +3 -3
  46. package/web/types/enum.js +2 -2
  47. package/web/types/record.d.ts +7 -7
  48. package/web/types/record.js +3 -3
  49. package/web/types/utils.d.ts +4 -3
  50. package/web/types/utils.js +6 -6
@@ -14,19 +14,19 @@
14
14
  *
15
15
  */
16
16
  import { isNumber } from "./primitive.js";
17
- import { makeOrPredicate, makeTemplatePredicate } from "./types.js";
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]);