@synnaxlabs/x 0.44.4 → 0.45.1

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 (150) hide show
  1. package/.turbo/turbo-build.log +38 -38
  2. package/dist/{base-BORMP3mH.js → base-DRybODwJ.js} +7 -6
  3. package/dist/base-KIBsp6TI.cjs +1 -0
  4. package/dist/binary.cjs +1 -1
  5. package/dist/binary.js +1 -1
  6. package/dist/{bounds-BXbqBINt.cjs → bounds-C2TKFgVk.cjs} +1 -1
  7. package/dist/{bounds-BQqppNFf.js → bounds-DeUXrllt.js} +11 -11
  8. package/dist/bounds.cjs +1 -1
  9. package/dist/bounds.js +1 -1
  10. package/dist/{box-DRH5SOaY.js → box-BYuq-Gjx.js} +4 -4
  11. package/dist/{box-qgxWXNhm.cjs → box-Blu-4d1n.cjs} +1 -1
  12. package/dist/box.cjs +1 -1
  13. package/dist/box.js +1 -1
  14. package/dist/caseconv.cjs +1 -1
  15. package/dist/caseconv.js +1 -1
  16. package/dist/compare.cjs +1 -1
  17. package/dist/compare.js +1 -1
  18. package/dist/deep.cjs +1 -1
  19. package/dist/deep.js +211 -99
  20. package/dist/{dimensions-qY12pyfC.cjs → dimensions-Cg5Owbwn.cjs} +1 -1
  21. package/dist/{dimensions-RaRkesPq.js → dimensions-DC0uLPwn.js} +1 -1
  22. package/dist/dimensions.cjs +1 -1
  23. package/dist/dimensions.js +1 -1
  24. package/dist/{direction-DKdfJwj7.js → direction-C_b4tfRN.js} +1 -1
  25. package/dist/{direction-XCdrc4is.cjs → direction-DqQB9M37.cjs} +1 -1
  26. package/dist/direction.cjs +1 -1
  27. package/dist/direction.js +1 -1
  28. package/dist/external-CtHGFcox.cjs +1 -0
  29. package/dist/{external-BM_NS5yM.js → external-tyaEMW4S.js} +1 -1
  30. package/dist/get-CXkBfLu1.js +82 -0
  31. package/dist/get-OP63N4c3.cjs +1 -0
  32. package/dist/{index-B5l_quQn.js → index-BHXRDFYj.js} +1 -1
  33. package/dist/index-Bxlv0uf_.js +57 -0
  34. package/dist/{index-CBMHFqs4.js → index-C452Pas0.js} +25 -22
  35. package/dist/{index-BQe8OIgm.cjs → index-CwGPVvbl.cjs} +1 -1
  36. package/dist/index-uDxeM-cl.cjs +1 -0
  37. package/dist/index-xaxa1hoa.cjs +1 -0
  38. package/dist/index.cjs +3 -3
  39. package/dist/index.js +442 -380
  40. package/dist/location-BPoXwOni.cjs +1 -0
  41. package/dist/{location-CGLioInQ.js → location-CVxysrHI.js} +31 -30
  42. package/dist/location.cjs +1 -1
  43. package/dist/location.js +1 -1
  44. package/dist/{scale-76Azh2EE.cjs → scale-BHs716im.cjs} +1 -1
  45. package/dist/{scale-BhIvACdB.js → scale-DjxC6ep2.js} +4 -4
  46. package/dist/scale.cjs +1 -1
  47. package/dist/scale.js +1 -1
  48. package/dist/series-C6ZwNf8i.cjs +6 -0
  49. package/dist/{series-kgnLXSDr.js → series-W5Aafjeu.js} +268 -251
  50. package/dist/{spatial-QY891r0E.js → spatial-DnsaOypA.js} +1 -1
  51. package/dist/{spatial-BsGadoUr.cjs → spatial-DrxzaD5U.cjs} +1 -1
  52. package/dist/spatial.cjs +1 -1
  53. package/dist/spatial.js +8 -8
  54. package/dist/src/caseconv/caseconv.d.ts +9 -0
  55. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  56. package/dist/src/color/color.d.ts +7 -0
  57. package/dist/src/color/color.d.ts.map +1 -1
  58. package/dist/src/deep/copy.spec.d.ts +2 -0
  59. package/dist/src/deep/copy.spec.d.ts.map +1 -0
  60. package/dist/src/deep/external.d.ts +3 -1
  61. package/dist/src/deep/external.d.ts.map +1 -1
  62. package/dist/src/deep/get.bench.d.ts +2 -0
  63. package/dist/src/deep/get.bench.d.ts.map +1 -0
  64. package/dist/src/deep/get.d.ts +16 -0
  65. package/dist/src/deep/get.d.ts.map +1 -0
  66. package/dist/src/deep/get.spec.d.ts +2 -0
  67. package/dist/src/deep/get.spec.d.ts.map +1 -0
  68. package/dist/src/deep/partial.spec.d.ts +2 -0
  69. package/dist/src/deep/partial.spec.d.ts.map +1 -0
  70. package/dist/src/deep/path.d.ts +4 -92
  71. package/dist/src/deep/path.d.ts.map +1 -1
  72. package/dist/src/deep/remove.bench.d.ts +2 -0
  73. package/dist/src/deep/remove.bench.d.ts.map +1 -0
  74. package/dist/src/deep/remove.d.ts +2 -0
  75. package/dist/src/deep/remove.d.ts.map +1 -0
  76. package/dist/src/deep/remove.spec.d.ts +2 -0
  77. package/dist/src/deep/remove.spec.d.ts.map +1 -0
  78. package/dist/src/deep/set.bench.d.ts +2 -0
  79. package/dist/src/deep/set.bench.d.ts.map +1 -0
  80. package/dist/src/deep/set.d.ts +2 -0
  81. package/dist/src/deep/set.d.ts.map +1 -0
  82. package/dist/src/deep/set.spec.d.ts +2 -0
  83. package/dist/src/deep/set.spec.d.ts.map +1 -0
  84. package/dist/src/index.d.ts +1 -0
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/primitive/primitive.d.ts +4 -0
  87. package/dist/src/primitive/primitive.d.ts.map +1 -1
  88. package/dist/src/spatial/location/location.d.ts +2 -2
  89. package/dist/src/spatial/location/location.d.ts.map +1 -1
  90. package/dist/src/status/status.d.ts +2 -1
  91. package/dist/src/status/status.d.ts.map +1 -1
  92. package/dist/src/telem/series.d.ts +1 -0
  93. package/dist/src/telem/series.d.ts.map +1 -1
  94. package/dist/src/telem/telem.d.ts +15 -6
  95. package/dist/src/telem/telem.d.ts.map +1 -1
  96. package/dist/src/undefined.d.ts +2 -0
  97. package/dist/src/undefined.d.ts.map +1 -0
  98. package/dist/telem.cjs +1 -1
  99. package/dist/telem.js +1 -1
  100. package/dist/{xy-BKIJiLu_.cjs → xy-DWwtHmgn.cjs} +1 -1
  101. package/dist/{xy-CBuhMaIo.js → xy-DYPw8-8C.js} +1 -1
  102. package/dist/xy.cjs +1 -1
  103. package/dist/xy.js +1 -1
  104. package/dist/zod.cjs +1 -1
  105. package/dist/zod.js +1 -1
  106. package/package.json +4 -4
  107. package/src/caseconv/caseconv.spec.ts +30 -0
  108. package/src/caseconv/caseconv.ts +46 -0
  109. package/src/color/color.spec.ts +40 -0
  110. package/src/color/color.ts +72 -0
  111. package/src/deep/copy.spec.ts +148 -0
  112. package/src/deep/external.ts +3 -1
  113. package/src/deep/get.bench.ts +170 -0
  114. package/src/deep/get.spec.ts +196 -0
  115. package/src/deep/get.ts +79 -0
  116. package/src/deep/partial.spec.ts +194 -0
  117. package/src/deep/path.spec.ts +92 -183
  118. package/src/deep/path.ts +27 -198
  119. package/src/deep/remove.bench.ts +238 -0
  120. package/src/deep/remove.spec.ts +219 -0
  121. package/src/deep/remove.ts +102 -0
  122. package/src/deep/set.bench.ts +208 -0
  123. package/src/deep/set.spec.ts +369 -0
  124. package/src/deep/set.ts +91 -0
  125. package/src/index.ts +1 -0
  126. package/src/primitive/primitive.spec.ts +9 -0
  127. package/src/primitive/primitive.ts +9 -0
  128. package/src/spatial/location/location.ts +2 -0
  129. package/src/status/status.spec.ts +52 -0
  130. package/src/status/status.ts +19 -6
  131. package/src/telem/series.ts +2 -0
  132. package/src/telem/telem.spec.ts +302 -0
  133. package/src/telem/telem.ts +60 -18
  134. package/src/undefined.ts +14 -0
  135. package/tsconfig.tsbuildinfo +1 -1
  136. package/dist/base-BLNViP3D.cjs +0 -1
  137. package/dist/external-E3ErJeeM.cjs +0 -1
  138. package/dist/index-D2xcvEO5.js +0 -46
  139. package/dist/index-DOJlZHqJ.cjs +0 -1
  140. package/dist/index-DdhM_E4k.cjs +0 -1
  141. package/dist/location-DJ_K4SlP.cjs +0 -1
  142. package/dist/path-Blh4wJuA.js +0 -110
  143. package/dist/path-CPSfCjde.cjs +0 -1
  144. package/dist/series-tAhThbnz.cjs +0 -6
  145. package/dist/src/deep/delete.d.ts +0 -3
  146. package/dist/src/deep/delete.d.ts.map +0 -1
  147. package/dist/src/deep/delete.spec.d.ts +0 -2
  148. package/dist/src/deep/delete.spec.d.ts.map +0 -1
  149. package/src/deep/delete.spec.ts +0 -73
  150. package/src/deep/delete.ts +0 -27
package/dist/deep.js CHANGED
@@ -1,135 +1,247 @@
1
- import { isObject as y } from "./identity.js";
2
- import { e as h, g as d, h as A, p as j, r as k, a as V, s as w, t as E } from "./path-Blh4wJuA.js";
3
- const O = (t) => {
1
+ import { S as a, d as j, f as g, a as u, e as x, g as I, h as w, p as K, r as O, t as V } from "./get-CXkBfLu1.js";
2
+ import { isObject as d } from "./identity.js";
3
+ const N = (i) => {
4
4
  try {
5
- return structuredClone(t);
5
+ return structuredClone(i);
6
6
  } catch {
7
7
  return console.warn(
8
8
  "Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",
9
- t
10
- ), console.trace(), JSON.parse(JSON.stringify(t));
9
+ i
10
+ ), console.trace(), JSON.parse(JSON.stringify(i));
11
11
  }
12
- }, $ = (t, ...f) => (f.forEach((i) => {
13
- let r = t;
14
- const l = i.split(".");
15
- l.forEach((s, e) => {
16
- typeof r != "object" || r === null || (e === l.length - 1 ? delete r[s] : s in r && (r = r[s]));
17
- });
18
- }), t), _ = (t, f, i = "") => {
19
- const r = {}, l = (s, e, n) => {
20
- if (typeof s != typeof e || s === null || e === null) {
21
- r[n] = [s, e];
12
+ }, $ = (i, c, o = "") => {
13
+ const t = {}, n = (l, e, r) => {
14
+ if (typeof l != typeof e || l === null || e === null) {
15
+ t[r] = [l, e];
22
16
  return;
23
17
  }
24
- if (typeof s == "object" && typeof e == "object")
25
- if (Array.isArray(s) && Array.isArray(e)) {
26
- if (s.length !== e.length) {
27
- r[n] = [s, e];
18
+ if (typeof l == "object" && typeof e == "object")
19
+ if (Array.isArray(l) && Array.isArray(e)) {
20
+ if (l.length !== e.length) {
21
+ t[r] = [l, e];
28
22
  return;
29
23
  }
30
- for (let o = 0; o < s.length; o++) l(s[o], e[o], `${n}[${o}]`);
24
+ for (let s = 0; s < l.length; s++) n(l[s], e[s], `${r}[${s}]`);
31
25
  } else
32
- (/* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(e)])).forEach((c) => {
33
- l(
34
- s[c],
35
- e[c],
36
- n !== "" ? `${n}.${c}` : c
26
+ (/* @__PURE__ */ new Set([...Object.keys(l), ...Object.keys(e)])).forEach((f) => {
27
+ n(
28
+ l[f],
29
+ e[f],
30
+ r !== "" ? `${r}.${f}` : f
37
31
  );
38
32
  });
39
- else s !== e && (r[n] = [s, e]);
33
+ else l !== e && (t[r] = [l, e]);
40
34
  };
41
- return l(t, f, i), r;
42
- }, u = (t, f) => {
43
- const i = Array.isArray(t), r = Array.isArray(f);
44
- if (i !== r) return !1;
45
- if (i && r) {
46
- const e = t, n = f;
47
- if (e.length !== n.length) return !1;
48
- for (let o = 0; o < e.length; o++) if (!u(e[o], n[o])) return !1;
35
+ return n(i, c, o), t;
36
+ }, h = (i, c) => {
37
+ const o = Array.isArray(i), t = Array.isArray(c);
38
+ if (o !== t) return !1;
39
+ if (o && t) {
40
+ const e = i, r = c;
41
+ if (e.length !== r.length) return !1;
42
+ for (let s = 0; s < e.length; s++) if (!h(e[s], r[s])) return !1;
49
43
  return !0;
50
44
  }
51
- if (t == null || f == null || typeof t != "object" || typeof f != "object")
52
- return t === f;
53
- if ("equals" in t) return t.equals(f);
54
- const l = Object.keys(t), s = Object.keys(f);
55
- if (l.length !== s.length) return !1;
56
- for (const e of l) {
57
- const n = t[e], o = f[e];
58
- if (typeof n == "object" && typeof o == "object") {
59
- if (!u(n, o)) return !1;
60
- } else if (n !== o) return !1;
45
+ if (i == null || c == null || typeof i != "object" || typeof c != "object")
46
+ return i === c;
47
+ if ("equals" in i) return i.equals(c);
48
+ const n = Object.keys(i), l = Object.keys(c);
49
+ if (n.length !== l.length) return !1;
50
+ for (const e of n) {
51
+ const r = i[e], s = c[e];
52
+ if (typeof r == "object" && typeof s == "object") {
53
+ if (!h(r, s)) return !1;
54
+ } else if (r !== s) return !1;
61
55
  }
62
56
  return !0;
63
- }, g = (t, f) => {
64
- if (typeof t != "object" || t == null) return t === f;
65
- const i = Object.keys(t), r = Object.keys(f);
66
- if (r.length > i.length) return !1;
67
- for (const l of r) {
68
- const s = t[l], e = f[l];
69
- if (typeof s == "object" && typeof e == "object") {
70
- if (!g(s, e)) return !1;
71
- } else if (s !== e) return !1;
57
+ }, k = (i, c) => {
58
+ if (typeof i != "object" || i == null) return i === c;
59
+ const o = Object.keys(i), t = Object.keys(c);
60
+ if (t.length > o.length) return !1;
61
+ for (const n of t) {
62
+ const l = i[n], e = c[n];
63
+ if (typeof l == "object" && typeof e == "object") {
64
+ if (!k(l, e)) return !1;
65
+ } else if (l !== e) return !1;
72
66
  }
73
67
  return !0;
74
- }, p = (t, ...f) => {
75
- if (f.length === 0) return t;
76
- const i = f.shift();
77
- if (y(t) && y(i))
78
- for (const r in i)
68
+ }, A = (i, ...c) => {
69
+ if (c.length === 0) return i;
70
+ const o = c.shift();
71
+ if (d(i) && d(o))
72
+ for (const t in o)
79
73
  try {
80
- y(i[r]) ? (r in t || Object.assign(t, { [r]: {} }), p(t[r], i[r])) : Object.assign(t, { [r]: i[r] });
81
- } catch (l) {
82
- throw l instanceof TypeError ? new TypeError(`.${r}: ${l.message}`) : l;
74
+ d(o[t]) ? (t in i || Object.assign(i, { [t]: {} }), A(i[t], o[t])) : Object.assign(i, { [t]: o[t] });
75
+ } catch (n) {
76
+ throw n instanceof TypeError ? new TypeError(`.${t}: ${n.message}`) : n;
83
77
  }
84
- return p(t, ...f);
85
- }, q = (t, f, i) => {
86
- const r = (l, s, e) => {
78
+ return A(i, ...c);
79
+ }, E = (i, c, o) => {
80
+ const t = (n, l, e) => {
87
81
  if (e.def?.type === "union")
88
82
  return e.def.options.reduce(
89
- (n, o) => r(n, s, o),
90
- l
83
+ (r, s) => t(r, l, s),
84
+ n
91
85
  );
92
86
  if (e.def?.type === "intersection") {
93
- const n = r(l, s, e.def.left);
94
- return r(n, s, e.def.right);
87
+ const r = t(n, l, e.def.left);
88
+ return t(r, l, e.def.right);
95
89
  }
96
- for (const n in s) {
97
- const o = s[n];
98
- let c = e?.shape;
99
- if (c != null)
100
- for (; c != null; ) {
101
- if (c[n] != null) {
102
- const a = c[n].safeParse(o);
103
- if (a.success) {
104
- l[n] = a.data;
90
+ for (const r in l) {
91
+ const s = l[r];
92
+ let f = e?.shape;
93
+ if (f != null)
94
+ for (; f != null; ) {
95
+ if (f[r] != null) {
96
+ const y = f[r].safeParse(s);
97
+ if (y.success) {
98
+ n[r] = y.data;
105
99
  break;
106
100
  }
107
101
  }
108
- c = c.def?.shape;
102
+ f = f.def?.shape;
109
103
  }
110
- typeof o == "object" && !Array.isArray(o) && o !== null && e && e.shape && e.shape[n] && (l[n] ||= {}, r(l[n], o, e.shape[n]));
104
+ typeof s == "object" && !Array.isArray(s) && s !== null && e && e.shape && e.shape[r] && (n[r] ||= {}, t(n[r], s, e.shape[r]));
111
105
  }
112
- return l;
106
+ return n;
113
107
  };
114
- return r({ ...t }, f, i);
115
- }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
108
+ return t({ ...i }, c, o);
109
+ }, _ = (i, c) => {
110
+ const o = c.split(a);
111
+ let t = i, n = 0;
112
+ for (; n < o.length; ) {
113
+ if (n === o.length - 1) {
114
+ const e = o[n];
115
+ if (Array.isArray(t)) {
116
+ const r = parseInt(e);
117
+ if (!isNaN(r) && r < t.length) {
118
+ t.splice(r, 1);
119
+ return;
120
+ }
121
+ const s = t[0];
122
+ if (typeof s == "object" && "key" in s) {
123
+ const f = t.findIndex((y) => y.key === e);
124
+ if (f !== -1) {
125
+ t.splice(f, 1);
126
+ return;
127
+ }
128
+ }
129
+ return;
130
+ }
131
+ delete t[e];
132
+ return;
133
+ }
134
+ let l = !1;
135
+ if (Array.isArray(t) && t.length > 0) {
136
+ const e = t[0];
137
+ if (typeof e == "object" && "key" in e)
138
+ for (let r = o.length - n; r >= 1; r--) {
139
+ const s = o.slice(n, n + r).join(a), f = t.find((y) => y.key === s);
140
+ if (f != null) {
141
+ if (n + r === o.length) {
142
+ const y = t.findIndex((p) => p.key === s);
143
+ y !== -1 && t.splice(y, 1);
144
+ return;
145
+ }
146
+ t = f, n += r, l = !0;
147
+ break;
148
+ }
149
+ }
150
+ }
151
+ if (!l)
152
+ for (let e = o.length - n; e >= 1; e--) {
153
+ const r = o.slice(n, n + e).join(a);
154
+ if (!Array.isArray(t) && typeof t == "object" && t !== null && r in t) {
155
+ if (n + e === o.length) {
156
+ delete t[r];
157
+ return;
158
+ }
159
+ t = t[r], n += e, l = !0;
160
+ break;
161
+ }
162
+ }
163
+ if (!l) {
164
+ const e = j(t, o[n]);
165
+ if (e == null) return;
166
+ t = e, n++;
167
+ }
168
+ }
169
+ }, m = (i, c, o) => {
170
+ const t = c.split(a);
171
+ let n = i, l = 0;
172
+ for (; l < t.length - 1; ) {
173
+ const e = g(n, t.slice(l, t.length - 1));
174
+ let r;
175
+ e != null ? [r, l] = [e[0], l + e[1]] : (r = t[l], l++);
176
+ let s = j(n, r);
177
+ if (s == null) {
178
+ const f = t[l];
179
+ let y = u(f);
180
+ y == null && f.startsWith("-") && u(f.substring(1)) != null && (y = 0), s = y != null ? [] : {}, n[r] = s;
181
+ }
182
+ n = s;
183
+ }
184
+ try {
185
+ const e = t[t.length - 1];
186
+ if (Array.isArray(n)) {
187
+ let s = u(e);
188
+ if (s == null) {
189
+ if (e.startsWith("-")) {
190
+ const f = u(e.substring(1));
191
+ f != null && (s = n.length - f);
192
+ }
193
+ if (s == null) {
194
+ if (n.length === 0) {
195
+ const y = u(e);
196
+ if (y != null) {
197
+ n[y] = o;
198
+ return;
199
+ }
200
+ }
201
+ const f = n[0];
202
+ if (typeof f == "object" && "key" in f) {
203
+ const y = n.findIndex((p) => p.key === e);
204
+ if (y !== -1) {
205
+ n[y] = o;
206
+ return;
207
+ }
208
+ }
209
+ return;
210
+ }
211
+ }
212
+ n[s] = o;
213
+ return;
214
+ }
215
+ const r = g(n, [e]);
216
+ if (r != null) {
217
+ n[r[0]] = o;
218
+ return;
219
+ }
220
+ n[e] = o;
221
+ } catch (e) {
222
+ throw console.error("failed to set value", o, "at path", c, "on object", i), e;
223
+ }
224
+ }, T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
116
225
  __proto__: null,
117
- copy: O,
118
- deleteD: $,
119
- difference: _,
120
- element: h,
121
- equal: u,
122
- get: d,
123
- has: A,
124
- override: p,
125
- overrideValidItems: q,
126
- partialEqual: g,
127
- pathsMatch: j,
128
- remove: k,
129
- resolvePath: V,
130
- set: w,
131
- transformPath: E
226
+ SEPARATOR: a,
227
+ copy: N,
228
+ defaultGetter: j,
229
+ difference: $,
230
+ element: x,
231
+ equal: h,
232
+ findBestKey: g,
233
+ get: I,
234
+ getIndex: u,
235
+ has: w,
236
+ override: A,
237
+ overrideValidItems: E,
238
+ partialEqual: k,
239
+ pathsMatch: K,
240
+ remove: _,
241
+ resolvePath: O,
242
+ set: m,
243
+ transformPath: V
132
244
  }, Symbol.toStringTag, { value: "Module" }));
133
245
  export {
134
- N as deep
246
+ T as deep
135
247
  };
@@ -1 +1 @@
1
- "use strict";const h=require("zod"),s=require("./base-BLNViP3D.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
1
+ "use strict";const h=require("zod"),s=require("./base-KIBsp6TI.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
@@ -1,5 +1,5 @@
1
1
  import { z as h } from "zod";
2
- import { d as o, x as g, n as a } from "./base-BORMP3mH.js";
2
+ import { d as o, x as g, n as a } from "./base-DRybODwJ.js";
3
3
  const r = h.object({ signedWidth: h.number(), signedHeight: h.number() }), c = h.union([o, r, g, a]), u = { width: 0, height: 0 }, m = { width: 1, height: 1 }, n = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, d = (t, e) => {
4
4
  if (e == null) return !1;
5
5
  const i = n(t), s = n(e);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-qY12pyfC.cjs");exports.dimensions=e.dimensions;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-Cg5Owbwn.cjs");exports.dimensions=e.dimensions;
@@ -1,4 +1,4 @@
1
- import { d } from "./dimensions-RaRkesPq.js";
1
+ import { d } from "./dimensions-DC0uLPwn.js";
2
2
  export {
3
3
  d as dimensions
4
4
  };
@@ -1,4 +1,4 @@
1
- import { c as i, D as n, Y as o, b as r } from "./base-BORMP3mH.js";
1
+ import { c as i, D as n, Y as o, b as r } from "./base-DRybODwJ.js";
2
2
  const s = i, t = (e) => n.includes(e) ? e : o.includes(e) ? "y" : "x", c = (e) => t(e) === "x" ? "y" : "x", d = (e) => t(e) === "x" ? "width" : "height", u = (e) => t(e) === "x" ? "left" : "top", a = (e) => s.safeParse(e).success, l = (e) => t(e) === "x" ? "signedWidth" : "signedHeight", f = (e) => e === "center" ? !1 : t(e) === "x", x = (e) => t(e) === "y", p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null,
4
4
  DIRECTIONS: n,
@@ -1 +1 @@
1
- "use strict";const n=require("./base-BLNViP3D.cjs"),i=n.crudeDirection,t=e=>n.DIRECTIONS.includes(e)?e:n.Y_LOCATIONS.includes(e)?"y":"x",s=e=>t(e)==="x"?"y":"x",c=e=>t(e)==="x"?"width":"height",o=e=>t(e)==="x"?"left":"top",r=e=>i.safeParse(e).success,u=e=>t(e)==="x"?"signedWidth":"signedHeight",d=e=>e==="center"?!1:t(e)==="x",l=e=>t(e)==="y",a=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:n.DIRECTIONS,construct:t,crude:i,dimension:c,direction:n.direction,isDirection:r,isX:d,isY:l,location:o,signedDimension:u,swap:s},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=a;
1
+ "use strict";const n=require("./base-KIBsp6TI.cjs"),i=n.crudeDirection,t=e=>n.DIRECTIONS.includes(e)?e:n.Y_LOCATIONS.includes(e)?"y":"x",s=e=>t(e)==="x"?"y":"x",c=e=>t(e)==="x"?"width":"height",o=e=>t(e)==="x"?"left":"top",r=e=>i.safeParse(e).success,u=e=>t(e)==="x"?"signedWidth":"signedHeight",d=e=>e==="center"?!1:t(e)==="x",l=e=>t(e)==="y",a=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:n.DIRECTIONS,construct:t,crude:i,dimension:c,direction:n.direction,isDirection:r,isX:d,isY:l,location:o,signedDimension:u,swap:s},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-XCdrc4is.cjs");exports.direction=e.direction;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-DqQB9M37.cjs");exports.direction=e.direction;
package/dist/direction.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d } from "./direction-DKdfJwj7.js";
1
+ import { d } from "./direction-C_b4tfRN.js";
2
2
  export {
3
3
  d as direction
4
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("zod"),s=require("./get-OP63N4c3.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),y=e=>a.array(e).or(e.transform(t=>[t])),u=e=>s.transformPath(e,(t,r,n)=>{const l=r===n.length-1,c=!isNaN(parseInt(t)),i=!isNaN(parseInt(n[r+1]));return c&&(t="element"),l||i?t:[t,"shape"]}),o=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},g=(e,t,r)=>t===""?e:s.get(o(e,"shape"),u(t),{...r,getter:o}),p=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:g,getFieldSchemaPath:u,nullToUndefined:f,toArray:y},Symbol.toStringTag,{value:"Module"}));exports.external=p;
@@ -1,5 +1,5 @@
1
1
  import a from "zod";
2
- import { t as i, g as f } from "./path-Blh4wJuA.js";
2
+ import { t as i, g as f } from "./get-CXkBfLu1.js";
3
3
  const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) => a.array(e).or(e.transform((t) => [t])), s = (e) => i(e, (t, r, n) => {
4
4
  const l = r === n.length - 1, u = !isNaN(parseInt(t)), c = !isNaN(parseInt(n[r + 1]));
5
5
  return u && (t = "element"), l || c ? t : [t, "shape"];
@@ -0,0 +1,82 @@
1
+ const o = ".", y = (n, t, r = o) => {
2
+ const e = n.split(r);
3
+ return e.map((s, u) => {
4
+ const l = t(s, u, e);
5
+ return l == null ? null : typeof l == "string" ? l : l.join(r);
6
+ }).filter((s) => s != null).join(r);
7
+ }, h = (n, t) => {
8
+ if (!Array.isArray(n)) return n[t];
9
+ const r = n[t];
10
+ if (r != null || n.length == 0) return r;
11
+ const e = n[0];
12
+ if (typeof e == "object" && "key" in e)
13
+ return n.find((i) => i.key === t);
14
+ }, d = (n, t) => {
15
+ const r = n.split(o);
16
+ return r.forEach((e, i) => {
17
+ t = h(t, e), t != null && typeof t == "object" && "key" in t && (r[i] = t.key);
18
+ }), r.join(o);
19
+ }, v = (n, t) => {
20
+ const r = n.split(o);
21
+ return t < 0 ? r[r.length + t] : r[t];
22
+ }, w = (n, t) => {
23
+ if (t.length === 0) return !0;
24
+ const r = n.split(o), e = t.split(o);
25
+ if (e.length > r.length) return !1;
26
+ for (let i = 0; i < e.length; i++) {
27
+ const s = r[i], u = e[i];
28
+ if (u !== "*" && s !== u)
29
+ return !1;
30
+ }
31
+ return !0;
32
+ }, $ = (n) => {
33
+ const t = parseInt(n);
34
+ return isNaN(t) || t < 0 || t.toString() !== n ? null : t;
35
+ }, E = (n, t) => {
36
+ for (let r = 1; r <= t.length; r++) {
37
+ const e = t.slice(0, r).join(o);
38
+ if (h(n, e) != null) return [e, r];
39
+ }
40
+ return null;
41
+ }, p = (n, t, r = { optional: !1 }) => {
42
+ const { optional: e, getter: i = h } = r;
43
+ if (t === "") return n;
44
+ const s = t.split(o);
45
+ if (s.length === 1) {
46
+ const l = i(n, s[0]);
47
+ if (l === void 0) {
48
+ if (e) return null;
49
+ throw new Error(`Path ${t} does not exist. ${s[0]} is undefined`);
50
+ }
51
+ return l;
52
+ }
53
+ const u = (l, f) => {
54
+ if (f >= s.length) return l;
55
+ for (let c = s.length - f; c >= 1; c--) {
56
+ const g = s.slice(f, f + c).join(o), a = i(l, g);
57
+ if (a !== void 0) {
58
+ if (f + c === s.length) return a;
59
+ if (a === null) {
60
+ if (e) return null;
61
+ throw new Error(`Path ${t} does not exist. ${g} is null`);
62
+ }
63
+ return u(a, f + c);
64
+ }
65
+ }
66
+ if (e) return null;
67
+ throw new Error(`Path ${t} does not exist. ${s[f]} is undefined`);
68
+ };
69
+ return u(n, 0);
70
+ }, P = (n, t) => p(n, t, { optional: !0 }) !== null;
71
+ export {
72
+ o as S,
73
+ $ as a,
74
+ h as d,
75
+ v as e,
76
+ E as f,
77
+ p as g,
78
+ P as h,
79
+ w as p,
80
+ d as r,
81
+ y as t
82
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o=".",y=(n,t,e=o)=>{const r=n.split(e);return r.map((s,u)=>{const i=t(s,u,r);return i==null?null:typeof i=="string"?i:i.join(e)}).filter(s=>s!=null).join(e)},a=(n,t)=>{if(!Array.isArray(n))return n[t];const e=n[t];if(e!=null||n.length==0)return e;const r=n[0];if(typeof r=="object"&&"key"in r)return n.find(l=>l.key===t)},p=(n,t)=>{const e=n.split(o);return e.forEach((r,l)=>{t=a(t,r),t!=null&&typeof t=="object"&&"key"in t&&(e[l]=t.key)}),e.join(o)},v=(n,t)=>{const e=n.split(o);return t<0?e[e.length+t]:e[t]},P=(n,t)=>{if(t.length===0)return!0;const e=n.split(o),r=t.split(o);if(r.length>e.length)return!1;for(let l=0;l<r.length;l++){const s=e[l],u=r[l];if(u!=="*"&&s!==u)return!1}return!0},m=n=>{const t=parseInt(n);return isNaN(t)||t<0||t.toString()!==n?null:t},w=(n,t)=>{for(let e=1;e<=t.length;e++){const r=t.slice(0,e).join(o);if(a(n,r)!=null)return[r,e]}return null},d=(n,t,e={optional:!1})=>{const{optional:r,getter:l=a}=e;if(t==="")return n;const s=t.split(o);if(s.length===1){const i=l(n,s[0]);if(i===void 0){if(r)return null;throw new Error(`Path ${t} does not exist. ${s[0]} is undefined`)}return i}const u=(i,f)=>{if(f>=s.length)return i;for(let c=s.length-f;c>=1;c--){const g=s.slice(f,f+c).join(o),h=l(i,g);if(h!==void 0){if(f+c===s.length)return h;if(h===null){if(r)return null;throw new Error(`Path ${t} does not exist. ${g} is null`)}return u(h,f+c)}}if(r)return null;throw new Error(`Path ${t} does not exist. ${s[f]} is undefined`)};return u(n,0)},A=(n,t)=>d(n,t,{optional:!0})!==null;exports.SEPARATOR=o;exports.defaultGetter=a;exports.element=v;exports.findBestKey=w;exports.get=d;exports.getIndex=m;exports.has=A;exports.pathsMatch=P;exports.resolvePath=p;exports.transformPath=y;
@@ -1,4 +1,4 @@
1
- import { s as h, b as T } from "./index-D2xcvEO5.js";
1
+ import { s as h, b as T } from "./index-Bxlv0uf_.js";
2
2
  import { isObject as m } from "./identity.js";
3
3
  class a {
4
4
  contentType = "application/json";
@@ -0,0 +1,57 @@
1
+ const m = (e) => {
2
+ const r = e.replace(/_[a-z]/g, (t) => t[1].toUpperCase());
3
+ return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() || r.length === 0 ? r : r[0].toLowerCase() + r.slice(1);
4
+ }, u = (e) => {
5
+ const r = (t, n = f) => {
6
+ if (typeof t == "string") return e(t);
7
+ if (Array.isArray(t)) return t.map((i) => r(i, n));
8
+ if (!p(t)) return t;
9
+ n = v(n);
10
+ const s = {}, c = t;
11
+ return "toJSON" in c && typeof c.toJSON == "function" ? r(c.toJSON(), n) : (Object.keys(c).forEach((i) => {
12
+ let a = c[i];
13
+ const A = e(i);
14
+ n.recursive && (p(a) ? g(a) || (a = r(a, n)) : n.recursiveInArray && y(a) && (a = [...a].map((o) => {
15
+ let l = o;
16
+ return p(o) ? g(l) || (l = r(o, n)) : y(o) && (l = r({ key: o }, n).key), l;
17
+ }))), s[A] = a;
18
+ }), s);
19
+ };
20
+ return r;
21
+ }, C = u(m), O = (e) => (
22
+ // Don't convert the first character and don't convert a character that is after a
23
+ // non-alphanumeric character
24
+ e.replace(
25
+ /([a-z0-9])([A-Z])/g,
26
+ (r, t, n) => `${t}_${n.toLowerCase()}`
27
+ )
28
+ ), S = u(O), _ = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), k = [Number, String, Uint8Array], f = {
29
+ recursive: !0,
30
+ recursiveInArray: !0
31
+ }, v = (e = f) => (e.recursive == null ? e = f : e.recursiveInArray ??= !1, e), y = (e) => e != null && Array.isArray(e), p = (e) => e != null && typeof e == "object" && !Array.isArray(e), g = (e) => k.some((r) => e instanceof r), T = (e) => e.replace(/\s+/g, "-").replace(
32
+ /([a-z0-9])([A-Z])/g,
33
+ (r, t, n) => `${t}-${n.toLowerCase()}`
34
+ ).toLowerCase(), $ = u(T), b = (e) => {
35
+ if (e.length === 0) return e;
36
+ let r = e.replace(/[_-]/g, " ");
37
+ return r = r.replace(
38
+ /([a-z0-9])([A-Z])/g,
39
+ (t, n, s) => `${n} ${s}`
40
+ ), r = r.replace(
41
+ /([A-Z]+)([A-Z][a-z])/g,
42
+ (t, n, s) => `${n} ${s}`
43
+ ), r = r.replace(/\s+/g, " ").trim(), r = r.replace(/\b\w/g, (t) => t.toUpperCase()), r;
44
+ }, z = u(b), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
45
+ __proto__: null,
46
+ camelToSnake: S,
47
+ capitalize: _,
48
+ snakeToCamel: C,
49
+ toKebab: $,
50
+ toProperNoun: z
51
+ }, Symbol.toStringTag, { value: "Module" }));
52
+ export {
53
+ U as a,
54
+ S as b,
55
+ _ as c,
56
+ C as s
57
+ };
@@ -1,5 +1,6 @@
1
1
  import { a as m } from "./index-D4NCYiQB.js";
2
- class N {
2
+ const N = (e) => e != null && typeof e == "object" && "value" in e;
3
+ class p {
3
4
  /** The underlying primitive value */
4
5
  value;
5
6
  constructor(t) {
@@ -37,10 +38,11 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, b = (e) =
37
38
  default:
38
39
  return !1;
39
40
  }
40
- }, p = (e) => !b(e), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41
+ }, d = (e) => !b(e), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41
42
  __proto__: null,
42
- ValueExtension: N,
43
- isNonZero: p,
43
+ ValueExtension: p,
44
+ isCrudeValueExtension: N,
45
+ isNonZero: d,
44
46
  isStringer: l,
45
47
  isZero: b
46
48
  }, Symbol.toStringTag, { value: "Module" })), g = (e, t = !1) => {
@@ -69,10 +71,10 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, b = (e) =
69
71
  return console.warn(`sortFunc: unknown type ${o}`), () => -1;
70
72
  }
71
73
  return t ? h(r) : r;
72
- }, d = (e, t, o) => {
74
+ }, S = (e, t, o) => {
73
75
  const r = g(t[e], o);
74
76
  return (n, s) => r(n[e], s[e]);
75
- }, S = (e, t) => e.length !== t.length ? e.length - t.length : e.every((o, r) => o === t[r]) ? 0 : -1, f = (e, t) => {
77
+ }, y = (e, t) => e.length !== t.length ? e.length - t.length : e.every((o, r) => o === t[r]) ? 0 : -1, f = (e, t) => {
76
78
  if (e.length !== t.length) return e.length - t.length;
77
79
  if (e.length === 0) return 0;
78
80
  const o = g(e[0]), r = [...e].sort(o), n = [...t].sort(o);
@@ -80,7 +82,7 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, b = (e) =
80
82
  }, _ = (e, t) => {
81
83
  const o = m(e), r = m(t);
82
84
  return f(o, r);
83
- }, y = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, h = (e) => (t, o) => e(o, t), c = 0, A = -1, T = 1, E = (e) => e < c, P = (e) => e > c, j = (e) => e >= c, q = (e) => e === c, w = (e, t) => {
85
+ }, A = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, h = (e) => (t, o) => e(o, t), c = 0, E = -1, T = 1, P = (e) => e < c, j = (e) => e > c, q = (e) => e >= c, w = (e) => e === c, C = (e, t) => {
84
86
  const o = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(o), n = t.replace(/[\s_.-]+/g, "").match(o);
85
87
  if (!r || !n) return 0;
86
88
  for (let s = 0; s < Math.min(r.length, n.length); s++) {
@@ -98,29 +100,30 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, b = (e) =
98
100
  __proto__: null,
99
101
  EQUAL: c,
100
102
  GREATER_THAN: T,
101
- LESS_THAN: A,
102
- isEqualTo: q,
103
- isGreaterThan: P,
104
- isGreaterThanEqual: j,
105
- isLessThan: E,
103
+ LESS_THAN: E,
104
+ isEqualTo: w,
105
+ isGreaterThan: j,
106
+ isGreaterThanEqual: q,
107
+ isLessThan: P,
106
108
  newF: g,
107
- newFieldF: d,
108
- order: y,
109
- primitiveArrays: S,
109
+ newFieldF: S,
110
+ order: A,
111
+ primitiveArrays: y,
110
112
  reverseF: h,
111
- stringsWithNumbers: w,
113
+ stringsWithNumbers: C,
112
114
  uniqueUnorderedPrimitiveArrays: _,
113
115
  unorderedPrimitiveArrays: f
114
116
  }, Symbol.toStringTag, { value: "Module" }));
115
117
  export {
116
118
  c as E,
117
119
  T as G,
118
- A as L,
119
- N as V,
120
- P as a,
121
- E as b,
122
- k as c,
123
- q as i,
120
+ E as L,
121
+ p as V,
122
+ w as a,
123
+ j as b,
124
+ P as c,
125
+ k as d,
126
+ N as i,
124
127
  g as n,
125
128
  O as p
126
129
  };