@synnaxlabs/x 0.44.1 → 0.44.3
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/.turbo/turbo-build.log +19 -19
- package/dist/bounds-8OC_obRs.js +186 -0
- package/dist/bounds-CRK04jp7.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +56 -46
- package/dist/{external-BFgJjMcS.js → external-BM_NS5yM.js} +6 -6
- package/dist/external-E3ErJeeM.cjs +1 -0
- package/dist/{index-PNh31WTW.js → index-CBMHFqs4.js} +34 -33
- package/dist/index-DOJlZHqJ.cjs +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +235 -229
- package/dist/path-Blh4wJuA.js +110 -0
- package/dist/path-CPSfCjde.cjs +1 -0
- package/dist/{scale-C6qKDbRb.cjs → scale-C3fEtXxW.cjs} +1 -1
- package/dist/{scale-EWNUk-bn.js → scale-Db1Gunj0.js} +1 -1
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/series-BcF7A8Je.cjs +6 -0
- package/dist/{series-Bn5y1tD1.js → series-Cl3Vh_u-.js} +588 -471
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +2 -2
- package/dist/src/breaker/breaker.d.ts +2 -1
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/deep/copy.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts +1 -0
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/id/id.d.ts +3 -1
- package/dist/src/id/id.d.ts.map +1 -1
- package/dist/src/math/math.d.ts +2 -1
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/observe/observe.d.ts +1 -0
- package/dist/src/observe/observe.d.ts.map +1 -1
- package/dist/src/primitive/primitive.d.ts +13 -1
- package/dist/src/primitive/primitive.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +1 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/strings/strings.d.ts +1 -1
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +7 -0
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +78 -1
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +1 -1
- package/package.json +1 -1
- package/src/breaker/breaker.ts +4 -0
- package/src/deep/copy.ts +12 -1
- package/src/deep/path.spec.ts +41 -0
- package/src/deep/path.ts +19 -2
- package/src/id/id.ts +8 -4
- package/src/math/math.spec.ts +20 -0
- package/src/math/math.ts +32 -29
- package/src/observe/observe.ts +2 -0
- package/src/primitive/primitive.spec.ts +7 -4
- package/src/primitive/primitive.ts +17 -1
- package/src/spatial/bounds/bounds.ts +1 -1
- package/src/status/status.ts +11 -0
- package/src/strings/strings.spec.ts +3 -0
- package/src/strings/strings.ts +2 -1
- package/src/telem/series.spec.ts +543 -2
- package/src/telem/series.ts +28 -9
- package/src/telem/telem.spec.ts +556 -0
- package/src/telem/telem.ts +118 -5
- package/src/testutil/testutil.spec.ts +6 -3
- package/src/zod/util.ts +5 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bounds-D6e9xoHt.cjs +0 -1
- package/dist/bounds-Dj9nG39I.js +0 -174
- package/dist/external-mffsMzJx.cjs +0 -1
- package/dist/index-B1m2qvBT.cjs +0 -1
- package/dist/path-BXdMenka.js +0 -101
- package/dist/path-st_E5-LJ.cjs +0 -1
- package/dist/series-CYAhDD6B.cjs +0 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.44.
|
|
2
|
+
> @synnaxlabs/x@0.44.3 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[34m Synnax - Production mode[0m
|
|
@@ -41,8 +41,8 @@ computing gzip size...
|
|
|
41
41
|
[2mdist/[22m[36mspatial.js [39m[1m[2m 0.58 kB[22m[1m[22m[2m │ gzip: 0.29 kB[22m
|
|
42
42
|
[2mdist/[22m[36mdirection-8etxfKaR.js [39m[1m[2m 0.67 kB[22m[1m[22m[2m │ gzip: 0.38 kB[22m
|
|
43
43
|
[2mdist/[22m[36mexternal-BYuXBYJh.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
44
|
-
[2mdist/[22m[36mexternal-BFgJjMcS.js [39m[1m[2m 0.86 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
45
44
|
[2mdist/[22m[36mworker.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.40 kB[22m
|
|
45
|
+
[2mdist/[22m[36mexternal-BM_NS5yM.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
46
46
|
[2mdist/[22m[36mexternal-BPgtxa8d.js [39m[1m[2m 0.99 kB[22m[1m[22m[2m │ gzip: 0.56 kB[22m
|
|
47
47
|
[2mdist/[22m[36mobserve.js [39m[1m[2m 1.10 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
48
48
|
[2mdist/[22m[36mbase-DFq0vvGn.js [39m[1m[2m 1.23 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
@@ -50,18 +50,18 @@ computing gzip size...
|
|
|
50
50
|
[2mdist/[22m[36murl.js [39m[1m[2m 1.70 kB[22m[1m[22m[2m │ gzip: 0.76 kB[22m
|
|
51
51
|
[2mdist/[22m[36mindex-D2xcvEO5.js [39m[1m[2m 1.86 kB[22m[1m[22m[2m │ gzip: 0.89 kB[22m
|
|
52
52
|
[2mdist/[22m[36mposition-PQ6op54I.js [39m[1m[2m 2.23 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
53
|
-
[2mdist/[22m[36mpath-BXdMenka.js [39m[1m[2m 2.44 kB[22m[1m[22m[2m │ gzip: 0.89 kB[22m
|
|
54
53
|
[2mdist/[22m[36mindex-B5l_quQn.js [39m[1m[2m 2.56 kB[22m[1m[22m[2m │ gzip: 1.00 kB[22m
|
|
54
|
+
[2mdist/[22m[36mpath-Blh4wJuA.js [39m[1m[2m 2.72 kB[22m[1m[22m[2m │ gzip: 0.97 kB[22m
|
|
55
55
|
[2mdist/[22m[36mlocation-Ar5y2DX2.js [39m[1m[2m 2.86 kB[22m[1m[22m[2m │ gzip: 1.18 kB[22m
|
|
56
|
-
[2mdist/[22m[36mindex-
|
|
57
|
-
[2mdist/[22m[36mdeep.js [39m[1m[2m 3.
|
|
56
|
+
[2mdist/[22m[36mindex-CBMHFqs4.js [39m[1m[2m 3.62 kB[22m[1m[22m[2m │ gzip: 1.37 kB[22m
|
|
57
|
+
[2mdist/[22m[36mdeep.js [39m[1m[2m 3.93 kB[22m[1m[22m[2m │ gzip: 1.52 kB[22m
|
|
58
58
|
[2mdist/[22m[36mxy-C_-hb3Q2.js [39m[1m[2m 3.94 kB[22m[1m[22m[2m │ gzip: 1.47 kB[22m
|
|
59
|
-
[2mdist/[22m[36mbounds-
|
|
59
|
+
[2mdist/[22m[36mbounds-8OC_obRs.js [39m[1m[2m 6.20 kB[22m[1m[22m[2m │ gzip: 2.09 kB[22m
|
|
60
60
|
[2mdist/[22m[36mbox-CO_2_DGG.js [39m[1m[2m 6.44 kB[22m[1m[22m[2m │ gzip: 2.26 kB[22m
|
|
61
|
-
[2mdist/[22m[36mscale-
|
|
62
|
-
[2mdist/[22m[36mindex.js [39m[1m[
|
|
63
|
-
[2mdist/[22m[36mseries-
|
|
64
|
-
[vite:dts] Declaration files built in
|
|
61
|
+
[2mdist/[22m[36mscale-Db1Gunj0.js [39m[1m[2m 6.49 kB[22m[1m[22m[2m │ gzip: 1.89 kB[22m
|
|
62
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m27.17 kB[22m[1m[22m[2m │ gzip: 8.74 kB[22m
|
|
63
|
+
[2mdist/[22m[36mseries-Cl3Vh_u-.js [39m[1m[2m91.29 kB[22m[1m[22m[2m │ gzip: 19.32 kB[22m
|
|
64
|
+
[vite:dts] Declaration files built in 4531ms.
|
|
65
65
|
|
|
66
66
|
[33mGenerated an empty chunk: "destructor".[39m
|
|
67
67
|
[2mdist/[22m[36mdestructor.cjs [39m[1m[2m 0.01 kB[22m[1m[22m[2m │ gzip: 0.03 kB[22m
|
|
@@ -94,7 +94,7 @@ computing gzip size...
|
|
|
94
94
|
[2mdist/[22m[36mdirection-386XDm2w.cjs [39m[1m[2m 0.56 kB[22m[1m[22m[2m │ gzip: 0.35 kB[22m
|
|
95
95
|
[2mdist/[22m[36mexternal-B9AAGv50.cjs [39m[1m[2m 0.58 kB[22m[1m[22m[2m │ gzip: 0.30 kB[22m
|
|
96
96
|
[2mdist/[22m[36mspatial.cjs [39m[1m[2m 0.63 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m
|
|
97
|
-
[2mdist/[22m[36mexternal-
|
|
97
|
+
[2mdist/[22m[36mexternal-E3ErJeeM.cjs [39m[1m[2m 0.68 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
98
98
|
[2mdist/[22m[36mworker.cjs [39m[1m[2m 0.71 kB[22m[1m[22m[2m │ gzip: 0.39 kB[22m
|
|
99
99
|
[2mdist/[22m[36mobserve.cjs [39m[1m[2m 0.76 kB[22m[1m[22m[2m │ gzip: 0.36 kB[22m
|
|
100
100
|
[2mdist/[22m[36mexternal-uXk0Avrg.cjs [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m
|
|
@@ -103,15 +103,15 @@ computing gzip size...
|
|
|
103
103
|
[2mdist/[22m[36mindex-DdhM_E4k.cjs [39m[1m[2m 1.35 kB[22m[1m[22m[2m │ gzip: 0.72 kB[22m
|
|
104
104
|
[2mdist/[22m[36mbase-BAM2mqCy.cjs [39m[1m[2m 1.40 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
105
105
|
[2mdist/[22m[36mposition-DSy2hONH.cjs [39m[1m[2m 1.70 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
106
|
-
[2mdist/[22m[36mpath-st_E5-LJ.cjs [39m[1m[2m 1.78 kB[22m[1m[22m[2m │ gzip: 0.79 kB[22m
|
|
107
106
|
[2mdist/[22m[36mindex-BQe8OIgm.cjs [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.90 kB[22m
|
|
107
|
+
[2mdist/[22m[36mpath-CPSfCjde.cjs [39m[1m[2m 2.00 kB[22m[1m[22m[2m │ gzip: 0.88 kB[22m
|
|
108
108
|
[2mdist/[22m[36mlocation-DZi8ftXp.cjs [39m[1m[2m 2.49 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
109
|
-
[2mdist/[22m[36mindex-
|
|
110
|
-
[2mdist/[22m[36mdeep.cjs [39m[1m[2m 2.
|
|
109
|
+
[2mdist/[22m[36mindex-DOJlZHqJ.cjs [39m[1m[2m 2.54 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m
|
|
110
|
+
[2mdist/[22m[36mdeep.cjs [39m[1m[2m 2.79 kB[22m[1m[22m[2m │ gzip: 1.27 kB[22m
|
|
111
111
|
[2mdist/[22m[36mxy-CUE3QDNn.cjs [39m[1m[2m 2.88 kB[22m[1m[22m[2m │ gzip: 1.31 kB[22m
|
|
112
|
-
[2mdist/[22m[36mscale-
|
|
113
|
-
[2mdist/[22m[36mbounds-
|
|
112
|
+
[2mdist/[22m[36mscale-C3fEtXxW.cjs [39m[1m[2m 4.11 kB[22m[1m[22m[2m │ gzip: 1.47 kB[22m
|
|
113
|
+
[2mdist/[22m[36mbounds-CRK04jp7.cjs [39m[1m[2m 4.67 kB[22m[1m[22m[2m │ gzip: 1.85 kB[22m
|
|
114
114
|
[2mdist/[22m[36mbox-Cxki783Y.cjs [39m[1m[2m 4.99 kB[22m[1m[22m[2m │ gzip: 2.02 kB[22m
|
|
115
|
-
[2mdist/[22m[36mindex.cjs [39m[1m[2m20.
|
|
116
|
-
[2mdist/[22m[36mseries-
|
|
117
|
-
[32m✓ built in 5.
|
|
115
|
+
[2mdist/[22m[36mindex.cjs [39m[1m[2m20.62 kB[22m[1m[22m[2m │ gzip: 7.68 kB[22m
|
|
116
|
+
[2mdist/[22m[36mseries-BcF7A8Je.cjs [39m[1m[2m38.89 kB[22m[1m[22m[2m │ gzip: 10.27 kB[22m
|
|
117
|
+
[32m✓ built in 5.37s[39m
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { j as x } from "./base-DFq0vvGn.js";
|
|
2
|
+
const a = (r) => (e, n) => {
|
|
3
|
+
if (typeof e == "bigint") {
|
|
4
|
+
if (g(n))
|
|
5
|
+
return r(e, BigInt(n));
|
|
6
|
+
const t = r(Number(e), Number(n));
|
|
7
|
+
return typeof t == "number" ? BigInt(Math.round(t)) : t;
|
|
8
|
+
}
|
|
9
|
+
return r(Number(e), Number(n));
|
|
10
|
+
}, w = a((r, e) => r - e), v = a((r, e) => r + e), q = (r, e, n = 1e-4) => Math.abs(r - e) < n, y = (r, e) => {
|
|
11
|
+
const n = typeof r == "bigint", t = typeof e == "bigint";
|
|
12
|
+
return n && t ? r === e : n && g(e) ? r === BigInt(e) : t && g(r) ? e === BigInt(r) : r === e;
|
|
13
|
+
}, R = (r) => {
|
|
14
|
+
const e = 10 ** Math.floor(Math.log10(r));
|
|
15
|
+
return Math.round(r / e) * e;
|
|
16
|
+
}, B = a((r, e) => r <= e ? r : e), g = (r) => typeof r == "bigint" ? !0 : Number.isInteger(r), U = a((r, e) => r >= e ? r : e), _ = (r) => typeof r == "bigint" ? r < 0n ? -r : r : r < 0 ? -r : r, W = a((r, e) => r * e), G = a((r, e) => r / e), s = (r, e, n) => {
|
|
17
|
+
const t = {};
|
|
18
|
+
if (typeof e == "object" && (n = e, e = void 0), n = { makeValid: !0, ...n }, typeof r == "number" || typeof r == "bigint")
|
|
19
|
+
e != null ? (t.lower = r, t.upper = e) : (t.lower = typeof r == "bigint" ? 0n : 0, t.upper = r);
|
|
20
|
+
else if (Array.isArray(r)) {
|
|
21
|
+
if (r.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
22
|
+
[t.lower, t.upper] = r;
|
|
23
|
+
} else
|
|
24
|
+
t.lower = r.lower, t.upper = r.upper;
|
|
25
|
+
return n?.makeValid ? h(t) : t;
|
|
26
|
+
}, N = Object.freeze({ lower: 0, upper: 0 }), M = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), j = Object.freeze({ lower: 0, upper: 1 }), A = Object.freeze({ lower: -1, upper: 1 }), O = (r, e) => {
|
|
27
|
+
if (r == null && e == null) return !0;
|
|
28
|
+
if (r == null || e == null) return !1;
|
|
29
|
+
const n = s(r), t = s(e);
|
|
30
|
+
return n?.lower === t?.lower && n?.upper === t?.upper;
|
|
31
|
+
}, h = (r) => r.lower > r.upper ? { lower: r.upper, upper: r.lower } : r, P = (r, e) => {
|
|
32
|
+
const n = s(r);
|
|
33
|
+
return e < n.lower ? n.lower : e >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : e;
|
|
34
|
+
}, f = (r, e) => {
|
|
35
|
+
const n = s(r);
|
|
36
|
+
if (typeof e == "number" || typeof e == "bigint")
|
|
37
|
+
return e >= n.lower && e < n.upper;
|
|
38
|
+
const t = s(e);
|
|
39
|
+
return t.lower >= n.lower && t.upper <= n.upper;
|
|
40
|
+
}, z = (r, e) => {
|
|
41
|
+
const n = s(r), t = s(e);
|
|
42
|
+
return n.lower === t.lower ? !0 : t.upper === n.lower || t.lower === n.upper ? !1 : f(n, t.upper) || f(n, t.lower) || f(t, n.upper) || f(t, n.lower);
|
|
43
|
+
}, d = (r) => {
|
|
44
|
+
const e = s(r);
|
|
45
|
+
return e.upper - e.lower;
|
|
46
|
+
}, E = (r) => {
|
|
47
|
+
const e = s(r);
|
|
48
|
+
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
49
|
+
}, k = (r) => {
|
|
50
|
+
const e = d(r);
|
|
51
|
+
return typeof e == "number" ? e === 0 : e === 0n;
|
|
52
|
+
}, D = (r) => {
|
|
53
|
+
const e = s(r);
|
|
54
|
+
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
55
|
+
}, F = (r) => {
|
|
56
|
+
const e = s(r);
|
|
57
|
+
return (e.upper + e.lower) / 2;
|
|
58
|
+
}, L = (r) => ({
|
|
59
|
+
lower: Math.min(...r.map((e) => s(e).lower)),
|
|
60
|
+
upper: Math.max(...r.map((e) => s(e).upper))
|
|
61
|
+
}), T = (r) => ({
|
|
62
|
+
lower: Math.max(...r.map((e) => s(e).lower)),
|
|
63
|
+
upper: Math.min(...r.map((e) => s(e).upper))
|
|
64
|
+
}), Z = (r) => {
|
|
65
|
+
const e = s(r), n = typeof e.lower == "bigint";
|
|
66
|
+
return Array.from({ length: Number(d(r)) }, (t, o) => n ? e.lower + BigInt(o) : e.lower + o);
|
|
67
|
+
}, I = (r, e) => {
|
|
68
|
+
const n = r.map((u) => s(u)), t = n.findIndex((u) => f(u, e) || e < u.lower);
|
|
69
|
+
if (t === -1) return { index: r.length, position: 0 };
|
|
70
|
+
const o = n[t];
|
|
71
|
+
return f(o, e) ? { index: t, position: Number(e - o.lower) } : { index: t, position: 0 };
|
|
72
|
+
}, b = {
|
|
73
|
+
removeBefore: 0,
|
|
74
|
+
removeAfter: 0,
|
|
75
|
+
insertInto: 0,
|
|
76
|
+
deleteInBetween: 0
|
|
77
|
+
}, C = (r, e) => {
|
|
78
|
+
const n = r.map((l) => s(l)), t = s(e);
|
|
79
|
+
if (n.length === 0) return b;
|
|
80
|
+
const o = I(n, t.lower), u = I(n, t.upper);
|
|
81
|
+
if (o.index === r.length) return { ...b, insertInto: r.length };
|
|
82
|
+
if (u.index === 0) return { ...b, removeAfter: u.position };
|
|
83
|
+
if (o.index === u.index)
|
|
84
|
+
return o.position !== 0 && u.position !== 0 ? null : {
|
|
85
|
+
removeAfter: u.position,
|
|
86
|
+
removeBefore: o.position,
|
|
87
|
+
insertInto: o.index,
|
|
88
|
+
deleteInBetween: 0
|
|
89
|
+
};
|
|
90
|
+
let i = u.index - o.index, c = o.index, p = w(Number(d(n[o.index])), o.position);
|
|
91
|
+
return o.position !== 0 ? (i -= 1, c += 1) : p = 0, {
|
|
92
|
+
removeBefore: p,
|
|
93
|
+
removeAfter: u.position,
|
|
94
|
+
insertInto: c,
|
|
95
|
+
deleteInBetween: i
|
|
96
|
+
};
|
|
97
|
+
}, S = (r, e, n) => {
|
|
98
|
+
const t = r.map((c) => s(c)), o = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
99
|
+
if (o === 0) return e;
|
|
100
|
+
let u = n, i = e;
|
|
101
|
+
for (; y(u, 0) === !1; ) {
|
|
102
|
+
const c = t.findIndex((p) => o > 0 ? i >= p.lower && i < p.upper : i > p.lower && i <= p.upper);
|
|
103
|
+
if (c !== -1) {
|
|
104
|
+
const p = t[c];
|
|
105
|
+
let l;
|
|
106
|
+
if (o > 0 ? l = w(p.upper, i) : l = w(i, p.lower), l > 0) {
|
|
107
|
+
const m = B(_(u), l);
|
|
108
|
+
if (i = v(
|
|
109
|
+
i,
|
|
110
|
+
o > 0 ? m : -m
|
|
111
|
+
), u = w(u, o > 0 ? m : -m), y(u, 0)) return i;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (o > 0) {
|
|
116
|
+
const p = t.filter((l) => l.lower > i);
|
|
117
|
+
if (p.length > 0) i = p[0].lower;
|
|
118
|
+
else return i;
|
|
119
|
+
} else {
|
|
120
|
+
const p = t.filter((l) => l.upper < i);
|
|
121
|
+
if (p.length > 0)
|
|
122
|
+
i = p[p.length - 1].upper;
|
|
123
|
+
else return i;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return i;
|
|
127
|
+
}, V = (r, e, n) => {
|
|
128
|
+
const t = r.map((i) => s(i));
|
|
129
|
+
if (e === n) return typeof e == "bigint" ? 0n : 0;
|
|
130
|
+
const o = e < n ? s([e, n]) : s([n, e]);
|
|
131
|
+
let u = typeof e == "bigint" ? 0n : 0;
|
|
132
|
+
for (const i of t) {
|
|
133
|
+
const c = i.lower > o.lower ? i.lower : o.lower, p = i.upper < o.upper ? i.upper : o.upper;
|
|
134
|
+
if (c < p) {
|
|
135
|
+
const l = p - c;
|
|
136
|
+
u = u + l;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return u;
|
|
140
|
+
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
141
|
+
__proto__: null,
|
|
142
|
+
CLIP: A,
|
|
143
|
+
DECIMAL: j,
|
|
144
|
+
INFINITE: M,
|
|
145
|
+
ZERO: N,
|
|
146
|
+
bounds: x,
|
|
147
|
+
buildInsertionPlan: C,
|
|
148
|
+
clamp: P,
|
|
149
|
+
construct: s,
|
|
150
|
+
contains: f,
|
|
151
|
+
distance: V,
|
|
152
|
+
equals: O,
|
|
153
|
+
findInsertPosition: I,
|
|
154
|
+
isFinite: D,
|
|
155
|
+
isZero: E,
|
|
156
|
+
linspace: Z,
|
|
157
|
+
makeValid: h,
|
|
158
|
+
max: L,
|
|
159
|
+
mean: F,
|
|
160
|
+
min: T,
|
|
161
|
+
overlapsWith: z,
|
|
162
|
+
span: d,
|
|
163
|
+
spanIsZero: k,
|
|
164
|
+
traverse: S
|
|
165
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
166
|
+
export {
|
|
167
|
+
v as a,
|
|
168
|
+
H as b,
|
|
169
|
+
s as c,
|
|
170
|
+
G as d,
|
|
171
|
+
P as e,
|
|
172
|
+
f,
|
|
173
|
+
L as g,
|
|
174
|
+
V as h,
|
|
175
|
+
d as i,
|
|
176
|
+
_ as j,
|
|
177
|
+
q as k,
|
|
178
|
+
y as l,
|
|
179
|
+
W as m,
|
|
180
|
+
g as n,
|
|
181
|
+
U as o,
|
|
182
|
+
B as p,
|
|
183
|
+
R as r,
|
|
184
|
+
w as s,
|
|
185
|
+
S as t
|
|
186
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const O=require("./base-BAM2mqCy.cjs"),d=r=>(e,n)=>{if(typeof e=="bigint"){if(b(n))return r(e,BigInt(n));const t=r(Number(e),Number(n));return typeof t=="number"?BigInt(Math.round(t)):t}return r(Number(e),Number(n))},m=d((r,e)=>r-e),h=d((r,e)=>r+e),j=(r,e,n=1e-4)=>Math.abs(r-e)<n,I=(r,e)=>{const n=typeof r=="bigint",t=typeof e=="bigint";return n&&t?r===e:n&&b(e)?r===BigInt(e):t&&b(r)?e===BigInt(r):r===e},P=r=>{const e=10**Math.floor(Math.log10(r));return Math.round(r/e)*e},x=d((r,e)=>r<=e?r:e),b=r=>typeof r=="bigint"?!0:Number.isInteger(r),T=d((r,e)=>r>=e?r:e),v=r=>typeof r=="bigint"?r<0n?-r:r:r<0?-r:r,z=d((r,e)=>r*e),E=d((r,e)=>r/e),u=(r,e,n)=>{const t={};if(typeof e=="object"&&(n=e,e=void 0),n={makeValid:!0,...n},typeof r=="number"||typeof r=="bigint")e!=null?(t.lower=r,t.upper=e):(t.lower=typeof r=="bigint"?0n:0,t.upper=r);else if(Array.isArray(r)){if(r.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=r}else t.lower=r.lower,t.upper=r.upper;return n?.makeValid?B(t):t},q=Object.freeze({lower:0,upper:0}),D=Object.freeze({lower:-1/0,upper:1/0}),F=Object.freeze({lower:0,upper:1}),L=Object.freeze({lower:-1,upper:1}),Z=(r,e)=>{if(r==null&&e==null)return!0;if(r==null||e==null)return!1;const n=u(r),t=u(e);return n?.lower===t?.lower&&n?.upper===t?.upper},B=r=>r.lower>r.upper?{lower:r.upper,upper:r.lower}:r,_=(r,e)=>{const n=u(r);return e<n.lower?n.lower:e>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):e},f=(r,e)=>{const n=u(r);if(typeof e=="number"||typeof e=="bigint")return e>=n.lower&&e<n.upper;const t=u(e);return t.lower>=n.lower&&t.upper<=n.upper},k=(r,e)=>{const n=u(r),t=u(e);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:f(n,t.upper)||f(n,t.lower)||f(t,n.upper)||f(t,n.lower)},w=r=>{const e=u(r);return e.upper-e.lower},C=r=>{const e=u(r);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},S=r=>{const e=w(r);return typeof e=="number"?e===0:e===0n},V=r=>{const e=u(r);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},$=r=>{const e=u(r);return(e.upper+e.lower)/2},N=r=>({lower:Math.min(...r.map(e=>u(e).lower)),upper:Math.max(...r.map(e=>u(e).upper))}),R=r=>({lower:Math.max(...r.map(e=>u(e).lower)),upper:Math.min(...r.map(e=>u(e).upper))}),U=r=>{const e=u(r),n=typeof e.lower=="bigint";return Array.from({length:Number(w(r))},(t,o)=>n?e.lower+BigInt(o):e.lower+o)},y=(r,e)=>{const n=r.map(s=>u(s)),t=n.findIndex(s=>f(s,e)||e<s.lower);if(t===-1)return{index:r.length,position:0};const o=n[t];return f(o,e)?{index:t,position:Number(e-o.lower)}:{index:t,position:0}},g={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},W=(r,e)=>{const n=r.map(l=>u(l)),t=u(e);if(n.length===0)return g;const o=y(n,t.lower),s=y(n,t.upper);if(o.index===r.length)return{...g,insertInto:r.length};if(s.index===0)return{...g,removeAfter:s.position};if(o.index===s.index)return o.position!==0&&s.position!==0?null:{removeAfter:s.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let i=s.index-o.index,c=o.index,p=m(Number(w(n[o.index])),o.position);return o.position!==0?(i-=1,c+=1):p=0,{removeBefore:p,removeAfter:s.position,insertInto:c,deleteInBetween:i}},M=(r,e,n)=>{const t=r.map(c=>u(c)),o=n>0?1:n<0?-1:0;if(o===0)return e;let s=n,i=e;for(;I(s,0)===!1;){const c=t.findIndex(p=>o>0?i>=p.lower&&i<p.upper:i>p.lower&&i<=p.upper);if(c!==-1){const p=t[c];let l;if(o>0?l=m(p.upper,i):l=m(i,p.lower),l>0){const a=x(v(s),l);if(i=h(i,o>0?a:-a),s=m(s,o>0?a:-a),I(s,0))return i;continue}}if(o>0){const p=t.filter(l=>l.lower>i);if(p.length>0)i=p[0].lower;else return i}else{const p=t.filter(l=>l.upper<i);if(p.length>0)i=p[p.length-1].upper;else return i}}return i},A=(r,e,n)=>{const t=r.map(i=>u(i));if(e===n)return typeof e=="bigint"?0n:0;const o=e<n?u([e,n]):u([n,e]);let s=typeof e=="bigint"?0n:0;for(const i of t){const c=i.lower>o.lower?i.lower:o.lower,p=i.upper<o.upper?i.upper:o.upper;if(c<p){const l=p-c;s=s+l}}return s},G=Object.freeze(Object.defineProperty({__proto__:null,CLIP:L,DECIMAL:F,INFINITE:D,ZERO:q,bounds:O.bounds,buildInsertionPlan:W,clamp:_,construct:u,contains:f,distance:A,equals:Z,findInsertPosition:y,isFinite:V,isZero:C,linspace:U,makeValid:B,max:N,mean:$,min:R,overlapsWith:k,span:w,spanIsZero:S,traverse:M},Symbol.toStringTag,{value:"Module"}));exports.abs=v;exports.add=h;exports.bounds=G;exports.clamp=_;exports.closeTo=j;exports.construct=u;exports.contains=f;exports.distance=A;exports.div=E;exports.equal=I;exports.isInteger=b;exports.max=N;exports.max$1=T;exports.min=x;exports.mult=z;exports.roundToNearestMagnitude=P;exports.span=w;exports.sub=m;exports.traverse=M;
|
package/dist/bounds.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-CRK04jp7.cjs");exports.bounds=e.bounds;
|
package/dist/bounds.js
CHANGED
package/dist/compare.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DOJlZHqJ.cjs");exports.compare=e.compare;
|
package/dist/compare.js
CHANGED
package/dist/deep.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-CPSfCjde.cjs"),d=t=>{try{return structuredClone(t)}catch{return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",t),console.trace(),JSON.parse(JSON.stringify(t))}},j=(t,...f)=>(f.forEach(i=>{let r=t;const l=i.split(".");l.forEach((n,e)=>{typeof r!="object"||r===null||(e===l.length-1?delete r[n]:n in r&&(r=r[n]))})}),t),A=(t,f,i="")=>{const r={},l=(n,e,s)=>{if(typeof n!=typeof e||n===null||e===null){r[s]=[n,e];return}if(typeof n=="object"&&typeof e=="object")if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length){r[s]=[n,e];return}for(let o=0;o<n.length;o++)l(n[o],e[o],`${s}[${o}]`)}else new Set([...Object.keys(n),...Object.keys(e)]).forEach(c=>{l(n[c],e[c],s!==""?`${s}.${c}`:c)});else n!==e&&(r[s]=[n,e])};return l(t,f,i),r},p=(t,f)=>{const i=Array.isArray(t),r=Array.isArray(f);if(i!==r)return!1;if(i&&r){const e=t,s=f;if(e.length!==s.length)return!1;for(let o=0;o<e.length;o++)if(!p(e[o],s[o]))return!1;return!0}if(t==null||f==null||typeof t!="object"||typeof f!="object")return t===f;if("equals"in t)return t.equals(f);const l=Object.keys(t),n=Object.keys(f);if(l.length!==n.length)return!1;for(const e of l){const s=t[e],o=f[e];if(typeof s=="object"&&typeof o=="object"){if(!p(s,o))return!1}else if(s!==o)return!1}return!0},h=(t,f)=>{if(typeof t!="object"||t==null)return t===f;const i=Object.keys(t),r=Object.keys(f);if(r.length>i.length)return!1;for(const l of r){const n=t[l],e=f[l];if(typeof n=="object"&&typeof e=="object"){if(!h(n,e))return!1}else if(n!==e)return!1}return!0},a=(t,...f)=>{if(f.length===0)return t;const i=f.shift();if(u.isObject(t)&&u.isObject(i))for(const r in i)try{u.isObject(i[r])?(r in t||Object.assign(t,{[r]:{}}),a(t[r],i[r])):Object.assign(t,{[r]:i[r]})}catch(l){throw l instanceof TypeError?new TypeError(`.${r}: ${l.message}`):l}return a(t,...f)},k=(t,f,i)=>{const r=(l,n,e)=>{if(e.def?.type==="union")return e.def.options.reduce((s,o)=>r(s,n,o),l);if(e.def?.type==="intersection"){const s=r(l,n,e.def.left);return r(s,n,e.def.right)}for(const s in n){const o=n[s];let c=e?.shape;if(c!=null)for(;c!=null;){if(c[s]!=null){const g=c[s].safeParse(o);if(g.success){l[s]=g.data;break}}c=c.def?.shape}typeof o=="object"&&!Array.isArray(o)&&o!==null&&e&&e.shape&&e.shape[s]&&(l[s]||={},r(l[s],o,e.shape[s]))}return l};return r({...t},f,i)},O=Object.freeze(Object.defineProperty({__proto__:null,copy:d,deleteD:j,difference:A,element:y.element,equal:p,get:y.get,has:y.has,override:a,overrideValidItems:k,partialEqual:h,pathsMatch:y.pathsMatch,remove:y.remove,resolvePath:y.resolvePath,set:y.set,transformPath:y.transformPath},Symbol.toStringTag,{value:"Module"}));exports.deep=O;
|
package/dist/deep.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
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,
|
|
3
|
-
const
|
|
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) => {
|
|
4
|
+
try {
|
|
5
|
+
return structuredClone(t);
|
|
6
|
+
} catch {
|
|
7
|
+
return console.warn(
|
|
8
|
+
"Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",
|
|
9
|
+
t
|
|
10
|
+
), console.trace(), JSON.parse(JSON.stringify(t));
|
|
11
|
+
}
|
|
12
|
+
}, $ = (t, ...f) => (f.forEach((i) => {
|
|
4
13
|
let r = t;
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
typeof r != "object" || r === null || (e ===
|
|
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]));
|
|
8
17
|
});
|
|
9
|
-
}), t),
|
|
10
|
-
const r = {},
|
|
18
|
+
}), t), _ = (t, f, i = "") => {
|
|
19
|
+
const r = {}, l = (s, e, n) => {
|
|
11
20
|
if (typeof s != typeof e || s === null || e === null) {
|
|
12
21
|
r[n] = [s, e];
|
|
13
22
|
return;
|
|
@@ -18,10 +27,10 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
|
|
|
18
27
|
r[n] = [s, e];
|
|
19
28
|
return;
|
|
20
29
|
}
|
|
21
|
-
for (let o = 0; o < s.length; o++)
|
|
30
|
+
for (let o = 0; o < s.length; o++) l(s[o], e[o], `${n}[${o}]`);
|
|
22
31
|
} else
|
|
23
32
|
(/* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(e)])).forEach((c) => {
|
|
24
|
-
|
|
33
|
+
l(
|
|
25
34
|
s[c],
|
|
26
35
|
e[c],
|
|
27
36
|
n !== "" ? `${n}.${c}` : c
|
|
@@ -29,59 +38,59 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
|
|
|
29
38
|
});
|
|
30
39
|
else s !== e && (r[n] = [s, e]);
|
|
31
40
|
};
|
|
32
|
-
return
|
|
33
|
-
}, u = (t,
|
|
34
|
-
const i = Array.isArray(t), r = Array.isArray(
|
|
41
|
+
return l(t, f, i), r;
|
|
42
|
+
}, u = (t, f) => {
|
|
43
|
+
const i = Array.isArray(t), r = Array.isArray(f);
|
|
35
44
|
if (i !== r) return !1;
|
|
36
45
|
if (i && r) {
|
|
37
|
-
const e = t, n =
|
|
46
|
+
const e = t, n = f;
|
|
38
47
|
if (e.length !== n.length) return !1;
|
|
39
48
|
for (let o = 0; o < e.length; o++) if (!u(e[o], n[o])) return !1;
|
|
40
49
|
return !0;
|
|
41
50
|
}
|
|
42
|
-
if (t == null ||
|
|
43
|
-
return t ===
|
|
44
|
-
if ("equals" in t) return t.equals(
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
for (const e of
|
|
48
|
-
const n = t[e], o =
|
|
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];
|
|
49
58
|
if (typeof n == "object" && typeof o == "object") {
|
|
50
59
|
if (!u(n, o)) return !1;
|
|
51
60
|
} else if (n !== o) return !1;
|
|
52
61
|
}
|
|
53
62
|
return !0;
|
|
54
|
-
}, g = (t,
|
|
55
|
-
if (typeof t != "object" || t == null) return t ===
|
|
56
|
-
const i = Object.keys(t), r = Object.keys(
|
|
63
|
+
}, g = (t, f) => {
|
|
64
|
+
if (typeof t != "object" || t == null) return t === f;
|
|
65
|
+
const i = Object.keys(t), r = Object.keys(f);
|
|
57
66
|
if (r.length > i.length) return !1;
|
|
58
|
-
for (const
|
|
59
|
-
const s = t[
|
|
67
|
+
for (const l of r) {
|
|
68
|
+
const s = t[l], e = f[l];
|
|
60
69
|
if (typeof s == "object" && typeof e == "object") {
|
|
61
70
|
if (!g(s, e)) return !1;
|
|
62
71
|
} else if (s !== e) return !1;
|
|
63
72
|
}
|
|
64
73
|
return !0;
|
|
65
|
-
}, p = (t, ...
|
|
66
|
-
if (
|
|
67
|
-
const i =
|
|
74
|
+
}, p = (t, ...f) => {
|
|
75
|
+
if (f.length === 0) return t;
|
|
76
|
+
const i = f.shift();
|
|
68
77
|
if (y(t) && y(i))
|
|
69
78
|
for (const r in i)
|
|
70
79
|
try {
|
|
71
80
|
y(i[r]) ? (r in t || Object.assign(t, { [r]: {} }), p(t[r], i[r])) : Object.assign(t, { [r]: i[r] });
|
|
72
|
-
} catch (
|
|
73
|
-
throw
|
|
81
|
+
} catch (l) {
|
|
82
|
+
throw l instanceof TypeError ? new TypeError(`.${r}: ${l.message}`) : l;
|
|
74
83
|
}
|
|
75
|
-
return p(t, ...
|
|
76
|
-
},
|
|
77
|
-
const r = (
|
|
84
|
+
return p(t, ...f);
|
|
85
|
+
}, q = (t, f, i) => {
|
|
86
|
+
const r = (l, s, e) => {
|
|
78
87
|
if (e.def?.type === "union")
|
|
79
88
|
return e.def.options.reduce(
|
|
80
89
|
(n, o) => r(n, s, o),
|
|
81
|
-
|
|
90
|
+
l
|
|
82
91
|
);
|
|
83
92
|
if (e.def?.type === "intersection") {
|
|
84
|
-
const n = r(
|
|
93
|
+
const n = r(l, s, e.def.left);
|
|
85
94
|
return r(n, s, e.def.right);
|
|
86
95
|
}
|
|
87
96
|
for (const n in s) {
|
|
@@ -92,34 +101,35 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
|
|
|
92
101
|
if (c[n] != null) {
|
|
93
102
|
const a = c[n].safeParse(o);
|
|
94
103
|
if (a.success) {
|
|
95
|
-
|
|
104
|
+
l[n] = a.data;
|
|
96
105
|
break;
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
c = c.def?.shape;
|
|
100
109
|
}
|
|
101
|
-
typeof o == "object" && !Array.isArray(o) && o !== null && e && e.shape && e.shape[n] && (
|
|
110
|
+
typeof o == "object" && !Array.isArray(o) && o !== null && e && e.shape && e.shape[n] && (l[n] ||= {}, r(l[n], o, e.shape[n]));
|
|
102
111
|
}
|
|
103
|
-
return
|
|
112
|
+
return l;
|
|
104
113
|
};
|
|
105
|
-
return r({ ...t },
|
|
106
|
-
},
|
|
114
|
+
return r({ ...t }, f, i);
|
|
115
|
+
}, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
107
116
|
__proto__: null,
|
|
108
|
-
copy:
|
|
109
|
-
deleteD:
|
|
110
|
-
difference:
|
|
117
|
+
copy: O,
|
|
118
|
+
deleteD: $,
|
|
119
|
+
difference: _,
|
|
111
120
|
element: h,
|
|
112
121
|
equal: u,
|
|
113
122
|
get: d,
|
|
114
123
|
has: A,
|
|
115
124
|
override: p,
|
|
116
|
-
overrideValidItems:
|
|
125
|
+
overrideValidItems: q,
|
|
117
126
|
partialEqual: g,
|
|
118
127
|
pathsMatch: j,
|
|
119
128
|
remove: k,
|
|
120
|
-
|
|
129
|
+
resolvePath: V,
|
|
130
|
+
set: w,
|
|
121
131
|
transformPath: E
|
|
122
132
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
123
133
|
export {
|
|
124
|
-
|
|
134
|
+
N as deep
|
|
125
135
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { t as i, g as f } from "./path-
|
|
3
|
-
const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) =>
|
|
4
|
-
const l = r === n.length - 1,
|
|
5
|
-
return
|
|
1
|
+
import a from "zod";
|
|
2
|
+
import { t as i, g as f } from "./path-Blh4wJuA.js";
|
|
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
|
+
const l = r === n.length - 1, u = !isNaN(parseInt(t)), c = !isNaN(parseInt(n[r + 1]));
|
|
5
|
+
return u && (t = "element"), l || c ? t : [t, "shape"];
|
|
6
6
|
}), o = (e, t) => {
|
|
7
7
|
if (e == null) return null;
|
|
8
8
|
const r = e[t];
|
|
9
9
|
return r == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : r;
|
|
10
|
-
}, y = (e, t, r) => f(
|
|
10
|
+
}, y = (e, t, r) => t === "" ? e : f(
|
|
11
11
|
o(e, "shape"),
|
|
12
12
|
s(t),
|
|
13
13
|
{ ...r, getter: o }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("zod"),s=require("./path-CPSfCjde.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),p=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},y=(e,t,r)=>t===""?e:s.get(o(e,"shape"),u(t),{...r,getter:o}),g=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:y,getFieldSchemaPath:u,nullToUndefined:f,toArray:p},Symbol.toStringTag,{value:"Module"}));exports.external=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as m } from "./index-D4NCYiQB.js";
|
|
2
|
-
class
|
|
2
|
+
class N {
|
|
3
3
|
/** The underlying primitive value */
|
|
4
4
|
value;
|
|
5
5
|
constructor(t) {
|
|
@@ -19,7 +19,7 @@ class h {
|
|
|
19
19
|
return this.value.toString();
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
const l = (e) => e != null && typeof e == "object" && "toString" in e,
|
|
22
|
+
const l = (e) => e != null && typeof e == "object" && "toString" in e, b = (e) => {
|
|
23
23
|
if (l(e)) return e?.toString().length === 0;
|
|
24
24
|
switch (typeof e) {
|
|
25
25
|
case "string":
|
|
@@ -37,11 +37,12 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, N = (e) =
|
|
|
37
37
|
default:
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
|
-
},
|
|
40
|
+
}, p = (e) => !b(e), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
41
41
|
__proto__: null,
|
|
42
|
-
ValueExtension:
|
|
42
|
+
ValueExtension: N,
|
|
43
|
+
isNonZero: p,
|
|
43
44
|
isStringer: l,
|
|
44
|
-
isZero:
|
|
45
|
+
isZero: b
|
|
45
46
|
}, Symbol.toStringTag, { value: "Module" })), g = (e, t = !1) => {
|
|
46
47
|
const o = l(e) ? "stringer" : typeof e;
|
|
47
48
|
let r;
|
|
@@ -67,19 +68,19 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, N = (e) =
|
|
|
67
68
|
default:
|
|
68
69
|
return console.warn(`sortFunc: unknown type ${o}`), () => -1;
|
|
69
70
|
}
|
|
70
|
-
return t ?
|
|
71
|
-
},
|
|
71
|
+
return t ? h(r) : r;
|
|
72
|
+
}, d = (e, t, o) => {
|
|
72
73
|
const r = g(t[e], o);
|
|
73
74
|
return (n, s) => r(n[e], s[e]);
|
|
74
|
-
},
|
|
75
|
+
}, S = (e, t) => e.length !== t.length ? e.length - t.length : e.every((o, r) => o === t[r]) ? 0 : -1, f = (e, t) => {
|
|
75
76
|
if (e.length !== t.length) return e.length - t.length;
|
|
76
77
|
if (e.length === 0) return 0;
|
|
77
78
|
const o = g(e[0]), r = [...e].sort(o), n = [...t].sort(o);
|
|
78
79
|
return r.every((s, i) => s === n[i]) ? 0 : -1;
|
|
79
|
-
},
|
|
80
|
+
}, _ = (e, t) => {
|
|
80
81
|
const o = m(e), r = m(t);
|
|
81
|
-
return
|
|
82
|
-
},
|
|
82
|
+
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) => {
|
|
83
84
|
const o = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(o), n = t.replace(/[\s_.-]+/g, "").match(o);
|
|
84
85
|
if (!r || !n) return 0;
|
|
85
86
|
for (let s = 0; s < Math.min(r.length, n.length); s++) {
|
|
@@ -93,33 +94,33 @@ const l = (e) => e != null && typeof e == "object" && "toString" in e, N = (e) =
|
|
|
93
94
|
} else return isNaN(Number(i)) ? -1 : 1;
|
|
94
95
|
}
|
|
95
96
|
return r.length - n.length;
|
|
96
|
-
},
|
|
97
|
+
}, k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
97
98
|
__proto__: null,
|
|
98
99
|
EQUAL: c,
|
|
99
|
-
GREATER_THAN:
|
|
100
|
-
LESS_THAN:
|
|
101
|
-
isEqualTo:
|
|
102
|
-
isGreaterThan:
|
|
103
|
-
isGreaterThanEqual:
|
|
104
|
-
isLessThan:
|
|
100
|
+
GREATER_THAN: T,
|
|
101
|
+
LESS_THAN: A,
|
|
102
|
+
isEqualTo: q,
|
|
103
|
+
isGreaterThan: P,
|
|
104
|
+
isGreaterThanEqual: j,
|
|
105
|
+
isLessThan: E,
|
|
105
106
|
newF: g,
|
|
106
|
-
newFieldF:
|
|
107
|
-
order:
|
|
108
|
-
primitiveArrays:
|
|
109
|
-
reverseF:
|
|
110
|
-
stringsWithNumbers:
|
|
111
|
-
uniqueUnorderedPrimitiveArrays:
|
|
112
|
-
unorderedPrimitiveArrays:
|
|
107
|
+
newFieldF: d,
|
|
108
|
+
order: y,
|
|
109
|
+
primitiveArrays: S,
|
|
110
|
+
reverseF: h,
|
|
111
|
+
stringsWithNumbers: w,
|
|
112
|
+
uniqueUnorderedPrimitiveArrays: _,
|
|
113
|
+
unorderedPrimitiveArrays: f
|
|
113
114
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
114
115
|
export {
|
|
115
116
|
c as E,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
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,
|
|
123
124
|
g as n,
|
|
124
|
-
|
|
125
|
+
O as p
|
|
125
126
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const m=require("./index-udOjA9d-.cjs");class h{value;constructor(t){this.value=t}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const g=e=>e!=null&&typeof e=="object"&&"toString"in e,b=e=>{if(g(e))return e?.toString().length===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return e==null;default:return!1}},A=e=>!b(e),E=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:h,isNonZero:A,isStringer:g,isZero:b},Symbol.toStringTag,{value:"Module"})),l=(e,t=!1)=>{const o=g(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?N(r):r},y=(e,t,o)=>{const r=l(t[e],o);return(n,s)=>r(n[e],s[e])},q=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,f=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=l(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},P=(e,t)=>{const o=m.unique$1(e),r=m.unique$1(t);return f(o,r)},w=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,N=e=>(t,o)=>e(o,t),u=0,p=-1,d=1,S=e=>e<u,T=e=>e>u,F=e=>e>=u,_=e=>e===u,j=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];if(isNaN(Number(i))&&isNaN(Number(a))){const c=i.localeCompare(a);if(c!==0)return c}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const c=Number(i)-Number(a);if(c!==0)return c}else return isNaN(Number(i))?-1:1}return r.length-n.length},v=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:u,GREATER_THAN:d,LESS_THAN:p,isEqualTo:_,isGreaterThan:T,isGreaterThanEqual:F,isLessThan:S,newF:l,newFieldF:y,order:w,primitiveArrays:q,reverseF:N,stringsWithNumbers:j,uniqueUnorderedPrimitiveArrays:P,unorderedPrimitiveArrays:f},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=u;exports.GREATER_THAN=d;exports.LESS_THAN=p;exports.ValueExtension=h;exports.compare=v;exports.isEqualTo=_;exports.isGreaterThan=T;exports.isLessThan=S;exports.newF=l;exports.primitive=E;
|