@zelgadis87/utils-core 4.9.0 → 4.10.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 (57) hide show
  1. package/dist/async/_index.d.ts +4 -0
  2. package/dist/index.d.ts +6 -6
  3. package/dist/lazy/_index.d.ts +2 -0
  4. package/dist/sorting/ComparisonChain.d.ts +1 -1
  5. package/dist/sorting/Sorter.d.ts +1 -1
  6. package/dist/sorting/_index.d.ts +4 -0
  7. package/dist/time/TimeDuration.d.ts +2 -2
  8. package/dist/time/TimeFrequency.d.ts +1 -1
  9. package/dist/time/TimeInstant.d.ts +15 -1
  10. package/dist/time/TimeRange.d.ts +1 -1
  11. package/dist/time/_index.d.ts +7 -0
  12. package/dist/time/types.d.ts +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/dist/upgrade/DataUpgrader.d.ts +1 -1
  15. package/dist/upgrade/_index.d.ts +2 -0
  16. package/dist/upgrade/getTransitionsPath.d.ts +1 -1
  17. package/dist/upgrade/types.d.ts +1 -1
  18. package/{src/utils/index.ts → dist/utils/_index.d.ts} +14 -16
  19. package/dist/utils/arrays/groupBy.d.ts +1 -1
  20. package/dist/utils/arrays/indexBy.d.ts +1 -1
  21. package/dist/utils/arrays.d.ts +1 -1
  22. package/dist/utils/css.d.ts +12 -6
  23. package/dist/utils/functions/iff.d.ts +1 -1
  24. package/dist/utils/index.d.ts +1 -1
  25. package/dist/utils/records/entries.d.ts +1 -1
  26. package/esbuild/index.cjs +30 -6
  27. package/esbuild/index.cjs.map +2 -2
  28. package/esbuild/index.mjs +30 -6
  29. package/esbuild/index.mjs.map +2 -2
  30. package/package.json +1 -1
  31. package/src/Logger.ts +1 -1
  32. package/src/async/_index.ts +7 -0
  33. package/src/index.ts +6 -6
  34. package/src/lazy/Lazy.ts +1 -1
  35. package/src/sorting/ComparisonChain.ts +1 -1
  36. package/src/sorting/Sorter.ts +1 -1
  37. package/src/time/TimeDuration.ts +2 -2
  38. package/src/time/TimeFrequency.ts +1 -1
  39. package/src/time/TimeInstant.ts +21 -1
  40. package/src/time/TimeRange.ts +1 -1
  41. package/src/time/_index.ts +9 -0
  42. package/src/time/types.ts +1 -1
  43. package/src/upgrade/DataUpgrader.ts +1 -2
  44. package/src/upgrade/getTransitionsPath.ts +1 -1
  45. package/src/upgrade/types.ts +1 -1
  46. package/src/utils/_index.ts +16 -0
  47. package/src/utils/arrays/groupBy.ts +1 -1
  48. package/src/utils/arrays/indexBy.ts +1 -1
  49. package/src/utils/arrays.ts +1 -1
  50. package/src/utils/css.ts +21 -12
  51. package/src/utils/functions/iff.ts +1 -1
  52. package/src/utils/records/entries.ts +1 -1
  53. package/src/async/index.ts +0 -7
  54. package/src/time/index.ts +0 -9
  55. /package/src/lazy/{index.ts → _index.ts} +0 -0
  56. /package/src/sorting/{index.ts → _index.ts} +0 -0
  57. /package/src/upgrade/{index.ts → _index.ts} +0 -0
package/esbuild/index.mjs CHANGED
@@ -634,16 +634,22 @@ var semiColon = ";";
634
634
  var space = " ";
635
635
  var openBracket = "{";
636
636
  var closeBracket = "}";
637
- function cssDeclarationRulesDictionaryToCss(syleDeclarationRulesForSelectors) {
637
+ function cssDeclarationRulesDictionaryToCss(syleDeclarationRulesForSelectorsProduceable, indent = 0) {
638
+ const syleDeclarationRulesForSelectors = produceableToValue(syleDeclarationRulesForSelectorsProduceable);
638
639
  return Object.entries(syleDeclarationRulesForSelectors).map(([selector, styleDeclarationRules]) => {
639
- const cssRules = cssSelectorDeclarationRulesDictionaryToCss(styleDeclarationRules);
640
+ const cssRules = cssSelectorDeclarationRulesDictionaryToCss(styleDeclarationRules, indent + 1);
640
641
  if (!cssRules.length) return null;
641
- return selector + space + openBracket + newLine + cssRules.map((rule) => tabulation + rule + semiColon).join(newLine) + newLine + closeBracket;
642
+ return repeat(tabulation, indent) + selector + space + openBracket + newLine + cssRules.join(newLine) + newLine + closeBracket;
642
643
  }).filter(Boolean).join(newLine + newLine);
643
644
  }
644
- function cssSelectorDeclarationRulesDictionaryToCss(styleDeclarationRulesProduceable) {
645
- const styleDeclarationRules = produceableToValue(styleDeclarationRulesProduceable);
646
- return Object.entries(styleDeclarationRules).map(([key, value]) => pascalCaseToKebabCase(key) + colon + space + produceableToValue(value));
645
+ function cssSelectorDeclarationRulesDictionaryToCss(styleDeclarationRules, indent = 0) {
646
+ return Object.entries(styleDeclarationRules).map(([key, value]) => {
647
+ if (typeof value === "string") {
648
+ return repeat(tabulation, indent) + pascalCaseToKebabCase(key) + colon + space + value + semiColon;
649
+ } else {
650
+ return repeat(tabulation, indent) + key + space + openBracket + newLine + cssSelectorDeclarationRulesDictionaryToCss(value, indent + 1).join(newLine) + newLine + repeat(tabulation, indent) + closeBracket;
651
+ }
652
+ });
647
653
  }
648
654
  function pascalCaseToKebabCase(s) {
649
655
  return s.split(/([A-Z][a-z]*)/).filter(Boolean).map((n) => n.toLowerCase()).join("-");
@@ -1794,12 +1800,30 @@ var TimeInstant = class _TimeInstant extends TimeBase {
1794
1800
  toDateUTC() {
1795
1801
  return new Date(this.ms + (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3);
1796
1802
  }
1803
+ /**
1804
+ * @deprecated use {@link TimeInstant#isInThePast2} instead.
1805
+ */
1797
1806
  get isInThePast() {
1798
1807
  return this.ms < Date.now();
1799
1808
  }
1809
+ /**
1810
+ * @deprecated use {@link TimeInstant#isInTheFuture2} instead.
1811
+ */
1800
1812
  get isInTheFuture() {
1801
1813
  return this.ms > Date.now();
1802
1814
  }
1815
+ /**
1816
+ * @returns true if the instant is in the past, false otherwise
1817
+ */
1818
+ isInThePast2() {
1819
+ return this.ms < Date.now();
1820
+ }
1821
+ /**
1822
+ * @returns true if the instant is in the future, false otherwise
1823
+ */
1824
+ isInTheFuture2() {
1825
+ return this.ms > Date.now();
1826
+ }
1803
1827
  isAfter(other) {
1804
1828
  return this.ms > other.ms;
1805
1829
  }