xypriss 9.12.12 → 9.12.14

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.
@@ -74,9 +74,56 @@ class UtilsApi {
74
74
  this.str = new StringUtils.StringUtils();
75
75
  /** **Number & Math Utilities** (`clamp`, `lerp`, `formatBytes`, etc.) */
76
76
  this.num = new NumberUtils.NumberUtils();
77
- /** **Date & Time Utilities** (`formatDuration`, `timeAgo`, etc.) */
77
+ /**
78
+ * @file DateUtils.ts
79
+ * @description XyPriss Date & Time Utilities — A comprehensive, zero-dependency
80
+ * date/time utility class built on the native `Date` object and the `Intl` API.
81
+ *
82
+ * @remarks
83
+ * All methods are pure and side-effect-free unless otherwise noted.
84
+ * Timestamps can be provided in either **seconds** (Unix) or **milliseconds**
85
+ * (JavaScript). The class auto-detects the unit using the heuristic:
86
+ * values below `1e11` are treated as seconds; values at or above `1e11` are
87
+ * treated as milliseconds. This heuristic is valid until **November 2286**.
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const du = new DateUtils();
92
+ *
93
+ * du.format(Date.now()); // "Apr 15, 2026"
94
+ * du.timeAgo(Date.now() - 90_000); // "2 minutes ago"
95
+ * du.formatDuration(3_661_000); // "1h 1m 1s"
96
+ * du.startOf("month"); // 2026-04-01T00:00:00.000Z
97
+ * ```
98
+ */
78
99
  this.date = new DateUtils.DateUtils();
79
- /** **Object Utilities** (`deepClone`, `parse`, `pick`, etc.) */
100
+ /**
101
+ * **ObjectWrapper — Fluent Object Instance**
102
+ *
103
+ * A chainable wrapper around a single object value, returned by
104
+ * `__sys__.utils.obj.of(...)`. It exposes the same object operations as
105
+ * `ObjectUtils`, but bound to the wrapped value so you don't have to
106
+ * pass `obj` as the first argument every time.
107
+ *
108
+ * This is purely additive: it does not replace or deprecate the
109
+ * static/instance methods on `ObjectUtils`. Both styles are fully
110
+ * supported and can be mixed freely.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const obj = __sys__.utils.obj.of({ a: 1, b: 2, c: 3 });
115
+ *
116
+ * const picked = obj.pick(["a", "c"]).value(); // { a: 1, c: 3 }
117
+ * const omitted = obj.omit(["b"]).value(); // { a: 1, c: 3 }
118
+ * const clone = obj.clone().value(); // deep copy
119
+ *
120
+ * // Chaining multiple operations:
121
+ * const result = __sys__.utils.obj.of({ a: 1, b: 2, c: 3, d: 4 })
122
+ * .omit(["d"])
123
+ * .pick(["a", "b"])
124
+ * .value(); // { a: 1, b: 2 }
125
+ * ```
126
+ */
80
127
  this.obj = new ObjectUtils.ObjectUtils();
81
128
  /** **Array Utilities** (`chunk`, `unique`, `groupBy`, etc.) */
82
129
  this.arr = new ArrayUtils.ArrayUtils();
@@ -1 +1 @@
1
- {"version":3,"file":"UtilsApi.js","sources":["../../../../src/xhsc/UtilsApi.ts"],"sourcesContent":[null],"names":["StringUtils","NumberUtils","DateUtils","ObjectUtils","ArrayUtils","AsyncUtils","ValidationUtils","IdUtils","FunctionUtils","LoggerUtils"],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBiF;AACjF;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;MACU,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;;AAEoB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIA,uBAAW,EAAE;;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;;AAGvB,QAAA,IAAA,CAAA,IAAI,GAAG,IAAIC,mBAAS,EAAE;;AAGtB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,qBAAU,EAAE;;AAGtB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAIC,qBAAU,EAAE;;AAGxB,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,+BAAe,EAAE;;AAG1B,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,eAAO,EAAE;;AAGlB,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,2BAAa,EAAE;AAExC;;;;;;;;;;;;AAYG;AACa,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;IAsB3C;AApBI;;;;;;;;;;;;;;AAcG;IACI,YAAY,CACf,OAAqD,EAAE,EAAA;AAEvD,QAAA,OAAO,IAAIA,uBAAW,CAAC,IAAI,CAAC;IAChC;AACH;;;;"}
1
+ {"version":3,"file":"UtilsApi.js","sources":["../../../../src/xhsc/UtilsApi.ts"],"sourcesContent":[null],"names":["StringUtils","NumberUtils","DateUtils","ObjectUtils","ArrayUtils","AsyncUtils","ValidationUtils","IdUtils","FunctionUtils","LoggerUtils"],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBiF;AACjF;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;MACU,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;;AAEoB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIA,uBAAW,EAAE;;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;AAEvC;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,QAAA,IAAA,CAAA,IAAI,GAAG,IAAIC,mBAAS,EAAE;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACa,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;;AAGvB,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,qBAAU,EAAE;;AAGtB,QAAA,IAAA,CAAA,KAAK,GAAG,IAAIC,qBAAU,EAAE;;AAGxB,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,+BAAe,EAAE;;AAG1B,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,eAAO,EAAE;;AAGlB,QAAA,IAAA,CAAA,EAAE,GAAG,IAAIC,2BAAa,EAAE;AAExC;;;;;;;;;;;;AAYG;AACa,QAAA,IAAA,CAAA,GAAG,GAAG,IAAIC,uBAAW,EAAE;IAsB3C;AApBI;;;;;;;;;;;;;;AAcG;IACI,YAAY,CACf,OAAqD,EAAE,EAAA;AAEvD,QAAA,OAAO,IAAIA,uBAAW,CAAC,IAAI,CAAC;IAChC;AACH;;;;"}