@synnaxlabs/x 0.44.0 → 0.44.2
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 +24 -24
- package/dist/box-CO_2_DGG.js +209 -0
- package/dist/box-Cxki783Y.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.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-Birv9jaY.js} +1 -1
- package/dist/{external-mffsMzJx.cjs → external-DsmsSN1Y.cjs} +1 -1
- package/dist/{index-PNh31WTW.js → index-CBMHFqs4.js} +34 -33
- package/dist/index-DOJlZHqJ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +9 -9
- package/dist/path-BeMr8xWN.cjs +1 -0
- package/dist/path-DVFrKaNI.js +107 -0
- package/dist/{position-DAL0Qqdf.cjs → position-DSy2hONH.cjs} +1 -1
- package/dist/{position-bA6pUwLn.js → position-PQ6op54I.js} +1 -1
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/{scale-Bzn1Cl0r.cjs → scale-C6qKDbRb.cjs} +1 -1
- package/dist/{scale-CdTNWu-d.js → scale-EWNUk-bn.js} +2 -2
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-anlpaR_I.cjs → series-CcA_WjbJ.cjs} +1 -1
- package/dist/{series-BeJyqCoP.js → series-EA1uaEDj.js} +4 -4
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +4 -4
- 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/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/spatial/box/box.d.ts +1 -0
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +1 -0
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy-CUE3QDNn.cjs +1 -0
- package/dist/{xy-D_LqxaGt.js → xy-C_-hb3Q2.js} +27 -22
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +1 -1
- package/package.json +3 -3
- package/src/deep/copy.ts +12 -1
- package/src/deep/path.spec.ts +27 -0
- package/src/deep/path.ts +10 -0
- 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/box/box.ts +5 -0
- package/src/spatial/xy/xy.ts +5 -0
- package/src/testutil/testutil.spec.ts +6 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/box-BcGdqkt4.cjs +0 -1
- package/dist/box-D_qdUyEe.js +0 -205
- 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/xy-B7065J2S.cjs +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.44.
|
|
2
|
+
> @synnaxlabs/x@0.44.2 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[34m Synnax - Production mode[0m
|
|
@@ -38,10 +38,10 @@ computing gzip size...
|
|
|
38
38
|
[2mdist/[22m[36mlink.js [39m[1m[2m 0.44 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
39
39
|
[2mdist/[22m[36mindex-D4NCYiQB.js [39m[1m[2m 0.45 kB[22m[1m[22m[2m │ gzip: 0.30 kB[22m
|
|
40
40
|
[2mdist/[22m[36mrecord-CAcQ5PNX.js [39m[1m[2m 0.51 kB[22m[1m[22m[2m │ gzip: 0.32 kB[22m
|
|
41
|
-
[2mdist/[22m[36mspatial.js [39m[1m[2m 0.58 kB[22m[1m[22m[2m │ gzip: 0.
|
|
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-
|
|
44
|
+
[2mdist/[22m[36mexternal-Birv9jaY.js [39m[1m[2m 0.86 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
45
45
|
[2mdist/[22m[36mworker.js [39m[1m[2m 0.87 kB[22m[1m[22m[2m │ gzip: 0.40 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
|
|
@@ -49,24 +49,24 @@ computing gzip size...
|
|
|
49
49
|
[2mdist/[22m[36mdimensions-CRgergMS.js [39m[1m[2m 1.49 kB[22m[1m[22m[2m │ gzip: 0.66 kB[22m
|
|
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
|
-
[2mdist/[22m[36mposition-
|
|
53
|
-
[2mdist/[22m[36mpath-BXdMenka.js [39m[1m[2m 2.44 kB[22m[1m[22m[2m │ gzip: 0.89 kB[22m
|
|
52
|
+
[2mdist/[22m[36mposition-PQ6op54I.js [39m[1m[2m 2.23 kB[22m[1m[22m[2m │ gzip: 1.06 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-DVFrKaNI.js [39m[1m[2m 2.63 kB[22m[1m[22m[2m │ gzip: 0.94 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.
|
|
58
|
-
[2mdist/[22m[36mxy-
|
|
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
|
+
[2mdist/[22m[36mxy-C_-hb3Q2.js [39m[1m[2m 3.94 kB[22m[1m[22m[2m │ gzip: 1.47 kB[22m
|
|
59
59
|
[2mdist/[22m[36mbounds-Dj9nG39I.js [39m[1m[2m 6.04 kB[22m[1m[22m[2m │ gzip: 2.00 kB[22m
|
|
60
|
-
[2mdist/[22m[36mbox-
|
|
61
|
-
[2mdist/[22m[36mscale-
|
|
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-EWNUk-bn.js [39m[1m[2m 6.49 kB[22m[1m[22m[2m │ gzip: 1.89 kB[22m
|
|
62
62
|
[2mdist/[22m[36mindex.js [39m[1m[2m26.85 kB[22m[1m[22m[2m │ gzip: 8.64 kB[22m
|
|
63
|
-
[2mdist/[22m[36mseries-
|
|
64
|
-
[vite:dts] Declaration files built in
|
|
63
|
+
[2mdist/[22m[36mseries-EA1uaEDj.js [39m[1m[2m87.74 kB[22m[1m[22m[2m │ gzip: 18.83 kB[22m
|
|
64
|
+
[vite:dts] Declaration files built in 4679ms.
|
|
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
|
|
68
|
-
[2mdist/[22m[36mxy.cjs [39m[1m[2m 0.13 kB[22m[1m[22m[2m │ gzip: 0.
|
|
69
|
-
[2mdist/[22m[36mbox.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.
|
|
68
|
+
[2mdist/[22m[36mxy.cjs [39m[1m[2m 0.13 kB[22m[1m[22m[2m │ gzip: 0.14 kB[22m
|
|
69
|
+
[2mdist/[22m[36mbox.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
70
70
|
[2mdist/[22m[36mscale.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
71
71
|
[2mdist/[22m[36mbinary.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
72
72
|
[2mdist/[22m[36munique.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 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-DsmsSN1Y.cjs [39m[1m[2m 0.67 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
|
|
@@ -102,16 +102,16 @@ computing gzip size...
|
|
|
102
102
|
[2mdist/[22m[36mdimensions-D2QGoNXO.cjs [39m[1m[2m 1.17 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
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
|
-
[2mdist/[22m[36mposition-
|
|
106
|
-
[2mdist/[22m[36mpath-
|
|
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-BeMr8xWN.cjs [39m[1m[2m 1.93 kB[22m[1m[22m[2m │ gzip: 0.84 kB[22m
|
|
107
107
|
[2mdist/[22m[36mindex-BQe8OIgm.cjs [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.90 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.
|
|
111
|
-
[2mdist/[22m[36mxy-
|
|
112
|
-
[2mdist/[22m[36mscale-
|
|
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
|
+
[2mdist/[22m[36mxy-CUE3QDNn.cjs [39m[1m[2m 2.88 kB[22m[1m[22m[2m │ gzip: 1.31 kB[22m
|
|
112
|
+
[2mdist/[22m[36mscale-C6qKDbRb.cjs [39m[1m[2m 4.11 kB[22m[1m[22m[2m │ gzip: 1.47 kB[22m
|
|
113
113
|
[2mdist/[22m[36mbounds-D6e9xoHt.cjs [39m[1m[2m 4.56 kB[22m[1m[22m[2m │ gzip: 1.77 kB[22m
|
|
114
|
-
[2mdist/[22m[36mbox-
|
|
114
|
+
[2mdist/[22m[36mbox-Cxki783Y.cjs [39m[1m[2m 4.99 kB[22m[1m[22m[2m │ gzip: 2.02 kB[22m
|
|
115
115
|
[2mdist/[22m[36mindex.cjs [39m[1m[2m20.35 kB[22m[1m[22m[2m │ gzip: 7.58 kB[22m
|
|
116
|
-
[2mdist/[22m[36mseries-
|
|
117
|
-
[32m✓ built in
|
|
116
|
+
[2mdist/[22m[36mseries-CcA_WjbJ.cjs [39m[1m[2m37.82 kB[22m[1m[22m[2m │ gzip: 10.09 kB[22m
|
|
117
|
+
[32m✓ built in 5.60s[39m
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { z as x } from "zod";
|
|
2
|
+
import { c as O } from "./direction-8etxfKaR.js";
|
|
3
|
+
import { c as A, T as M, B as N, b as S, d as Z, e as q, f as F, g as G, h as D, i as X, j as Y } from "./location-Ar5y2DX2.js";
|
|
4
|
+
import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-C_-hb3Q2.js";
|
|
5
|
+
import { x as j, X as H, Y as J } from "./base-DFq0vvGn.js";
|
|
6
|
+
const h = x.union([x.number(), x.string()]), K = x.object({
|
|
7
|
+
top: h,
|
|
8
|
+
left: h,
|
|
9
|
+
width: h,
|
|
10
|
+
height: h
|
|
11
|
+
}), Q = x.object({
|
|
12
|
+
left: x.number(),
|
|
13
|
+
top: x.number(),
|
|
14
|
+
right: x.number(),
|
|
15
|
+
bottom: x.number()
|
|
16
|
+
}), V = x.object({
|
|
17
|
+
one: j,
|
|
18
|
+
two: j,
|
|
19
|
+
root: A
|
|
20
|
+
}), P = { one: g, two: g, root: M }, oo = { one: g, two: U, root: N }, v = (o, t) => ({
|
|
21
|
+
one: o.one,
|
|
22
|
+
two: o.two,
|
|
23
|
+
root: t ?? o.root
|
|
24
|
+
}), c = (o, t, e = 0, n = 0, r) => {
|
|
25
|
+
const s = {
|
|
26
|
+
one: { ...g },
|
|
27
|
+
two: { ...g },
|
|
28
|
+
root: r ?? M
|
|
29
|
+
};
|
|
30
|
+
if (typeof o == "number") {
|
|
31
|
+
if (typeof t != "number")
|
|
32
|
+
throw new Error("Box constructor called with invalid arguments");
|
|
33
|
+
return s.one = { x: o, y: t }, s.two = { x: s.one.x + e, y: s.one.y + n }, s;
|
|
34
|
+
}
|
|
35
|
+
return "one" in o && "two" in o && "root" in o ? { ...o, root: r ?? o.root } : ("getBoundingClientRect" in o && (o = o.getBoundingClientRect()), "left" in o ? (s.one = { x: o.left, y: o.top }, s.two = { x: o.right, y: o.bottom }, s) : (s.one = o, t == null ? s.two = { x: s.one.x + e, y: s.one.y + n } : typeof t == "number" ? s.two = { x: s.one.x + t, y: s.one.y + e } : "width" in t ? s.two = {
|
|
36
|
+
x: s.one.x + t.width,
|
|
37
|
+
y: s.one.y + t.height
|
|
38
|
+
} : "signedWidth" in t ? s.two = {
|
|
39
|
+
x: s.one.x + t.signedWidth,
|
|
40
|
+
y: s.one.y + t.signedHeight
|
|
41
|
+
} : s.two = t, s));
|
|
42
|
+
}, to = (o, t, e) => {
|
|
43
|
+
const n = c(o);
|
|
44
|
+
if (typeof t == "string") {
|
|
45
|
+
if (e == null) throw new Error("Invalid arguments for resize");
|
|
46
|
+
const r = O(t);
|
|
47
|
+
return c(
|
|
48
|
+
n.one,
|
|
49
|
+
void 0,
|
|
50
|
+
r === "x" ? e : w(n),
|
|
51
|
+
r === "y" ? e : d(n),
|
|
52
|
+
n.root
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return c(n.one, t, void 0, void 0, n.root);
|
|
56
|
+
}, no = (o, t, e = !0) => {
|
|
57
|
+
const n = c(o);
|
|
58
|
+
let r = (s, i) => s < i;
|
|
59
|
+
return e && (r = (s, i) => s <= i), "one" in t ? r(a(n), a(t)) && r(f(t), f(n)) && r(u(n), u(t)) && r(l(t), l(n)) : r(a(n), t.x) && r(t.x, f(n)) && r(u(n), t.y) && r(t.y, l(n));
|
|
60
|
+
}, eo = (o, t) => I(o.one, t.one) && I(o.two, t.two) && S(o.root, t.root), W = (o) => ({
|
|
61
|
+
width: w(o),
|
|
62
|
+
height: d(o)
|
|
63
|
+
}), so = (o) => ({
|
|
64
|
+
signedWidth: _(o),
|
|
65
|
+
signedHeight: b(o)
|
|
66
|
+
}), ro = (o) => ({
|
|
67
|
+
top: u(o),
|
|
68
|
+
left: a(o),
|
|
69
|
+
width: w(o),
|
|
70
|
+
height: d(o)
|
|
71
|
+
}), C = (o, t, e = !1) => {
|
|
72
|
+
const n = O(t) === "y" ? b(o) : _(o);
|
|
73
|
+
return e ? n : Math.abs(n);
|
|
74
|
+
}, y = (o, t) => {
|
|
75
|
+
const e = c(o);
|
|
76
|
+
return {
|
|
77
|
+
x: t.x === "center" ? E(e).x : m(e, t.x),
|
|
78
|
+
y: t.y === "center" ? E(e).y : m(e, t.y)
|
|
79
|
+
};
|
|
80
|
+
}, m = (o, t) => {
|
|
81
|
+
const e = c(o), n = Z(e.root).includes(t) ? Math.min : Math.max;
|
|
82
|
+
return H.includes(t) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
+
}, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) => C(o, "x"), d = (o) => C(o, "y"), _ = (o) => {
|
|
84
|
+
const t = c(o);
|
|
85
|
+
return t.two.x - t.one.x;
|
|
86
|
+
}, b = (o) => {
|
|
87
|
+
const t = c(o);
|
|
88
|
+
return t.two.y - t.one.y;
|
|
89
|
+
}, z = (o) => y(o, M), io = (o) => y(o, q), xo = (o) => y(o, F), yo = (o) => y(o, N), ao = (o) => y(o, G), uo = (o) => y(o, D), wo = (o) => y(o, X), fo = (o) => y(o, Y), f = (o) => m(o, "right"), l = (o) => m(o, "bottom"), a = (o) => m(o, "left"), u = (o) => m(o, "top"), E = (o) => T(z(o), {
|
|
90
|
+
x: _(o) / 2,
|
|
91
|
+
y: b(o) / 2
|
|
92
|
+
}), B = (o) => {
|
|
93
|
+
const t = c(o);
|
|
94
|
+
return t.root.x === "left" ? a(t) : f(t);
|
|
95
|
+
}, R = (o) => {
|
|
96
|
+
const t = c(o);
|
|
97
|
+
return t.root.y === "top" ? u(t) : l(t);
|
|
98
|
+
}, lo = (o) => ({ x: B(o), y: R(o) }), mo = (o) => {
|
|
99
|
+
const t = c(o);
|
|
100
|
+
return { lower: t.one.x, upper: t.two.x };
|
|
101
|
+
}, po = (o) => {
|
|
102
|
+
const t = c(o);
|
|
103
|
+
return { lower: t.one.y, upper: t.two.y };
|
|
104
|
+
}, go = (o, t) => v(o, t), ho = (o, t) => {
|
|
105
|
+
const e = c(o), n = H.includes(t) ? "x" : J.includes(t) ? "y" : null;
|
|
106
|
+
if (n === null) throw new Error(`Invalid location: ${t}`);
|
|
107
|
+
const r = t === "top" || t === "left" ? Math.min : Math.max, s = { ...e.one }, i = { ...e.two };
|
|
108
|
+
return s[n] = r(e.one[n], e.two[n]), i[n] = r(e.one[n], e.two[n]), [s, i];
|
|
109
|
+
}, _o = (o, t) => {
|
|
110
|
+
const e = c(o), n = c(t), r = B(n) + (w(n) - w(e)) / 2, s = R(n) + (d(n) - d(e)) / 2;
|
|
111
|
+
return c({ x: r, y: s }, W(e));
|
|
112
|
+
}, bo = (o) => typeof o != "object" || o == null ? !1 : "one" in o && "two" in o && "root" in o, To = (o) => w(o) / d(o), Eo = (o, t, e) => {
|
|
113
|
+
if (typeof t == "string") {
|
|
114
|
+
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
+
const r = O(t);
|
|
116
|
+
t = k(r, e);
|
|
117
|
+
}
|
|
118
|
+
const n = c(o);
|
|
119
|
+
return c(
|
|
120
|
+
T(n.one, t),
|
|
121
|
+
T(n.two, t),
|
|
122
|
+
void 0,
|
|
123
|
+
void 0,
|
|
124
|
+
n.root
|
|
125
|
+
);
|
|
126
|
+
}, Oo = (o, t) => {
|
|
127
|
+
const e = Math.max(a(o), a(t)), n = Math.max(u(o), u(t)), r = Math.min(f(o), f(t)), s = Math.min(l(o), l(t));
|
|
128
|
+
return e > r || n > s ? P : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, o.root);
|
|
129
|
+
}, Mo = (o) => w(o) * d(o), Co = (o, t) => {
|
|
130
|
+
const e = c(o);
|
|
131
|
+
return c(
|
|
132
|
+
L(e.one, t),
|
|
133
|
+
L(e.two, t),
|
|
134
|
+
void 0,
|
|
135
|
+
void 0,
|
|
136
|
+
e.root
|
|
137
|
+
);
|
|
138
|
+
}, Bo = (o, t, e, n, r, s) => {
|
|
139
|
+
const i = { x: o, y: t }, p = { x: o + e, y: t + n };
|
|
140
|
+
return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, s);
|
|
141
|
+
}, Ro = (o) => {
|
|
142
|
+
const t = c(o);
|
|
143
|
+
return c($(t.one), $(t.two), void 0, void 0, t.root);
|
|
144
|
+
}, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
145
|
+
__proto__: null,
|
|
146
|
+
DECIMAL: oo,
|
|
147
|
+
ZERO: P,
|
|
148
|
+
area: Mo,
|
|
149
|
+
areaIsZero: co,
|
|
150
|
+
aspect: To,
|
|
151
|
+
bottom: l,
|
|
152
|
+
bottomCenter: ao,
|
|
153
|
+
bottomLeft: yo,
|
|
154
|
+
bottomRight: uo,
|
|
155
|
+
box: V,
|
|
156
|
+
center: E,
|
|
157
|
+
centerLeft: wo,
|
|
158
|
+
centerRight: fo,
|
|
159
|
+
construct: c,
|
|
160
|
+
constructWithAlternateRoot: Bo,
|
|
161
|
+
contains: no,
|
|
162
|
+
copy: v,
|
|
163
|
+
css: ro,
|
|
164
|
+
cssBox: K,
|
|
165
|
+
dim: C,
|
|
166
|
+
dims: W,
|
|
167
|
+
domRect: Q,
|
|
168
|
+
edgePoints: ho,
|
|
169
|
+
equals: eo,
|
|
170
|
+
height: d,
|
|
171
|
+
intersection: Oo,
|
|
172
|
+
isBox: bo,
|
|
173
|
+
left: a,
|
|
174
|
+
loc: m,
|
|
175
|
+
positionInCenter: _o,
|
|
176
|
+
reRoot: go,
|
|
177
|
+
resize: to,
|
|
178
|
+
right: f,
|
|
179
|
+
root: lo,
|
|
180
|
+
round: Ro,
|
|
181
|
+
signedDims: so,
|
|
182
|
+
signedHeight: b,
|
|
183
|
+
signedWidth: _,
|
|
184
|
+
top: u,
|
|
185
|
+
topCenter: io,
|
|
186
|
+
topLeft: z,
|
|
187
|
+
topRight: xo,
|
|
188
|
+
translate: Eo,
|
|
189
|
+
truncate: Co,
|
|
190
|
+
width: w,
|
|
191
|
+
x: B,
|
|
192
|
+
xBounds: mo,
|
|
193
|
+
xyLoc: y,
|
|
194
|
+
y: R,
|
|
195
|
+
yBounds: po
|
|
196
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
197
|
+
export {
|
|
198
|
+
Bo as a,
|
|
199
|
+
Ho as b,
|
|
200
|
+
c,
|
|
201
|
+
Mo as d,
|
|
202
|
+
bo as e,
|
|
203
|
+
mo as f,
|
|
204
|
+
d as h,
|
|
205
|
+
Oo as i,
|
|
206
|
+
w,
|
|
207
|
+
y as x,
|
|
208
|
+
po as y
|
|
209
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("zod"),R=require("./direction-386XDm2w.cjs"),u=require("./location-DZi8ftXp.cjs"),i=require("./xy-CUE3QDNn.cjs"),m=require("./base-BAM2mqCy.cjs"),p=y.z.union([y.z.number(),y.z.string()]),H=y.z.object({top:p,left:p,width:p,height:p}),W=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),v=y.z.object({one:m.xy,two:m.xy,root:u.corner}),B={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},S={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},C=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??u.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:l(n),s==="y"?e:w(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(a(n),a(o))&&s(_(o),_(n))&&s(f(n),f(o))&&s(h(o),h(n)):s(a(n),o.x)&&s(o.x,_(n))&&s(f(n),o.y)&&s(o.y,h(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),I=t=>({width:l(t),height:w(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:l(t),height:w(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},d=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,l=t=>L(t,"x"),w=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>d(t,u.TOP_LEFT),k=t=>d(t,u.TOP_CENTER),J=t=>d(t,u.TOP_RIGHT),K=t=>d(t,u.BOTTOM_LEFT),Q=t=>d(t,u.BOTTOM_CENTER),V=t=>d(t,u.BOTTOM_RIGHT),tt=t=>d(t,u.CENTER_LEFT),ot=t=>d(t,u.CENTER_RIGHT),_=t=>g(t,"right"),h=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):_(o)},z=t=>{const o=c(t);return o.root.y==="top"?f(o):h(o)},nt=t=>({x:M(t),y:z(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>C(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(l(n)-l(e))/2,r=z(n)+(w(n)-w(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>l(t)/w(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},j=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(_(t),_(o)),r=Math.min(h(t),h(o));return e>s||n>r?B:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},A=t=>l(t)*w(t),ut=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},F=(t,o,e,n,s,r)=>{const x={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,T.x-=e/2):(x.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,T.y-=n/2):(x.y-=n,T.y-=n)),c(x,T,void 0,void 0,r)},xt=t=>{const o=c(t);return c(i.round(o.one),i.round(o.two),void 0,void 0,o.root)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:S,ZERO:B,area:A,areaIsZero:Y,aspect:ct,bottom:h,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:v,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:F,contains:D,copy:C,css:U,cssBox:H,dim:L,dims:I,domRect:W,edgePoints:rt,equals:X,height:w,intersection:j,isBox:Z,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:_,root:nt,round:xt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:q,topRight:J,translate:it,truncate:ut,width:l,x:M,xBounds:N,xyLoc:d,y:z,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.area=A;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=w;exports.intersection=j;exports.isBox=Z;exports.width=l;exports.xBounds=N;exports.xyLoc=d;exports.yBounds=P;
|
package/dist/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-Cxki783Y.cjs");exports.box=e.box;
|
package/dist/box.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-BeMr8xWN.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-DVFrKaNI.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,5 +1,5 @@
|
|
|
1
1
|
import u from "zod";
|
|
2
|
-
import { t as i, g as f } from "./path-
|
|
2
|
+
import { t as i, g as f } from "./path-DVFrKaNI.js";
|
|
3
3
|
const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) => u.array(e).or(e.transform((t) => [t])), s = (e) => i(e, (t, r, n) => {
|
|
4
4
|
const l = r === n.length - 1, a = !isNaN(parseInt(t)), c = !isNaN(parseInt(n[r + 1]));
|
|
5
5
|
return a && (t = "element"), l || c ? t : [t, "shape"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("zod"),s=require("./path-
|
|
1
|
+
"use strict";const i=require("zod"),s=require("./path-BeMr8xWN.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),p=e=>i.array(e).or(e.transform(t=>[t])),c=e=>s.transformPath(e,(t,r,n)=>{const l=r===n.length-1,u=!isNaN(parseInt(t)),a=!isNaN(parseInt(n[r+1]));return u&&(t="element"),l||a?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)=>s.get(o(e,"shape"),c(t),{...r,getter:o}),m=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:y,getFieldSchemaPath:c,nullToUndefined:f,toArray:p},Symbol.toStringTag,{value:"Module"}));exports.external=m;
|