@jsdev_ninja/core 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +30 -27
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/entities/Cart.d.ts +7 -0
- package/dist/entities/Cart.d.ts.map +1 -1
- package/dist/entities/Order.d.ts +9 -0
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Product.d.ts +6 -0
- package/dist/entities/Product.d.ts.map +1 -1
- package/dist/entities/Product.js +4 -1
- package/lib/entities/Product.ts +4 -1
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -486,7 +486,7 @@ class _ {
|
|
|
486
486
|
return this._refinement((n, s) => e(n) ? !0 : (s.addIssue(typeof t == "function" ? t(n, s) : t), !1));
|
|
487
487
|
}
|
|
488
488
|
_refinement(e) {
|
|
489
|
-
return new
|
|
489
|
+
return new I({
|
|
490
490
|
schema: this,
|
|
491
491
|
typeName: y.ZodEffects,
|
|
492
492
|
effect: { type: "refinement", refinement: e }
|
|
@@ -503,7 +503,7 @@ class _ {
|
|
|
503
503
|
};
|
|
504
504
|
}
|
|
505
505
|
optional() {
|
|
506
|
-
return
|
|
506
|
+
return N.create(this, this._def);
|
|
507
507
|
}
|
|
508
508
|
nullable() {
|
|
509
509
|
return D.create(this, this._def);
|
|
@@ -524,7 +524,7 @@ class _ {
|
|
|
524
524
|
return ae.create(this, e, this._def);
|
|
525
525
|
}
|
|
526
526
|
transform(e) {
|
|
527
|
-
return new
|
|
527
|
+
return new I({
|
|
528
528
|
...v(this._def),
|
|
529
529
|
schema: this,
|
|
530
530
|
typeName: y.ZodEffects,
|
|
@@ -541,7 +541,7 @@ class _ {
|
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
brand() {
|
|
544
|
-
return new
|
|
544
|
+
return new Ie({
|
|
545
545
|
typeName: y.ZodBranded,
|
|
546
546
|
type: this,
|
|
547
547
|
...v(this._def)
|
|
@@ -1586,7 +1586,7 @@ function B(r) {
|
|
|
1586
1586
|
const e = {};
|
|
1587
1587
|
for (const t in r.shape) {
|
|
1588
1588
|
const n = r.shape[t];
|
|
1589
|
-
e[t] =
|
|
1589
|
+
e[t] = N.create(B(n));
|
|
1590
1590
|
}
|
|
1591
1591
|
return new x({
|
|
1592
1592
|
...r._def,
|
|
@@ -1595,7 +1595,7 @@ function B(r) {
|
|
|
1595
1595
|
} else return r instanceof A ? new A({
|
|
1596
1596
|
...r._def,
|
|
1597
1597
|
type: B(r.element)
|
|
1598
|
-
}) : r instanceof
|
|
1598
|
+
}) : r instanceof N ? N.create(B(r.unwrap())) : r instanceof D ? D.create(B(r.unwrap())) : r instanceof E ? E.create(r.items.map((e) => B(e))) : r;
|
|
1599
1599
|
}
|
|
1600
1600
|
class x extends _ {
|
|
1601
1601
|
constructor() {
|
|
@@ -1850,7 +1850,7 @@ class x extends _ {
|
|
|
1850
1850
|
t[n] = this.shape[n];
|
|
1851
1851
|
else {
|
|
1852
1852
|
let a = this.shape[n];
|
|
1853
|
-
for (; a instanceof
|
|
1853
|
+
for (; a instanceof N; )
|
|
1854
1854
|
a = a._def.innerType;
|
|
1855
1855
|
t[n] = a;
|
|
1856
1856
|
}
|
|
@@ -1957,7 +1957,7 @@ se.create = (r, e) => new se({
|
|
|
1957
1957
|
typeName: y.ZodUnion,
|
|
1958
1958
|
...v(e)
|
|
1959
1959
|
});
|
|
1960
|
-
const j = (r) => r instanceof oe ? j(r.schema) : r instanceof
|
|
1960
|
+
const j = (r) => r instanceof oe ? j(r.schema) : r instanceof I ? j(r.innerType()) : r instanceof de ? [r.value] : r instanceof V ? r.options : r instanceof ce ? b.objectValues(r.enum) : r instanceof ue ? j(r._def.innerType) : r instanceof re ? [void 0] : r instanceof ne ? [null] : r instanceof N ? [void 0, ...j(r.unwrap())] : r instanceof D ? [null, ...j(r.unwrap())] : r instanceof Ie || r instanceof fe ? j(r.unwrap()) : r instanceof le ? j(r._def.innerType) : [];
|
|
1961
1961
|
class ke extends _ {
|
|
1962
1962
|
_parse(e) {
|
|
1963
1963
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2547,7 +2547,7 @@ H.create = (r, e) => new H({
|
|
|
2547
2547
|
typeName: y.ZodPromise,
|
|
2548
2548
|
...v(e)
|
|
2549
2549
|
});
|
|
2550
|
-
class
|
|
2550
|
+
class I extends _ {
|
|
2551
2551
|
innerType() {
|
|
2552
2552
|
return this._def.schema;
|
|
2553
2553
|
}
|
|
@@ -2624,19 +2624,19 @@ class N extends _ {
|
|
|
2624
2624
|
b.assertNever(s);
|
|
2625
2625
|
}
|
|
2626
2626
|
}
|
|
2627
|
-
|
|
2627
|
+
I.create = (r, e, t) => new I({
|
|
2628
2628
|
schema: r,
|
|
2629
2629
|
typeName: y.ZodEffects,
|
|
2630
2630
|
effect: e,
|
|
2631
2631
|
...v(t)
|
|
2632
2632
|
});
|
|
2633
|
-
|
|
2633
|
+
I.createWithPreprocess = (r, e, t) => new I({
|
|
2634
2634
|
schema: e,
|
|
2635
2635
|
effect: { type: "preprocess", transform: r },
|
|
2636
2636
|
typeName: y.ZodEffects,
|
|
2637
2637
|
...v(t)
|
|
2638
2638
|
});
|
|
2639
|
-
class
|
|
2639
|
+
class N extends _ {
|
|
2640
2640
|
_parse(e) {
|
|
2641
2641
|
return this._getType(e) === h.undefined ? Z(void 0) : this._def.innerType._parse(e);
|
|
2642
2642
|
}
|
|
@@ -2644,7 +2644,7 @@ class I extends _ {
|
|
|
2644
2644
|
return this._def.innerType;
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
|
-
|
|
2647
|
+
N.create = (r, e) => new N({
|
|
2648
2648
|
innerType: r,
|
|
2649
2649
|
typeName: y.ZodOptional,
|
|
2650
2650
|
...v(e)
|
|
@@ -2743,7 +2743,7 @@ xe.create = (r) => new xe({
|
|
|
2743
2743
|
...v(r)
|
|
2744
2744
|
});
|
|
2745
2745
|
const yt = Symbol("zod_brand");
|
|
2746
|
-
class
|
|
2746
|
+
class Ie extends _ {
|
|
2747
2747
|
_parse(e) {
|
|
2748
2748
|
const { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2749
2749
|
return this._def.type._parse({
|
|
@@ -2841,7 +2841,7 @@ var y;
|
|
|
2841
2841
|
})(y || (y = {}));
|
|
2842
2842
|
const vt = (r, e = {
|
|
2843
2843
|
message: `Input not instance of ${r.name}`
|
|
2844
|
-
}) => ze((t) => t instanceof r, e), Ue = C.create, Fe = $.create, _t = xe.create, bt = M.create, Be = te.create, xt = U.create, kt = ve.create, wt = re.create, Tt = ne.create, Zt = Y.create, St = L.create, Ct = P.create, At = _e.create,
|
|
2844
|
+
}) => ze((t) => t instanceof r, e), Ue = C.create, Fe = $.create, _t = xe.create, bt = M.create, Be = te.create, xt = U.create, kt = ve.create, wt = re.create, Tt = ne.create, Zt = Y.create, St = L.create, Ct = P.create, At = _e.create, It = A.create, Nt = x.create, Ot = x.strictCreate, Et = se.create, jt = ke.create, Rt = ae.create, Pt = E.create, $t = ie.create, Mt = be.create, Vt = F.create, Dt = q.create, Lt = oe.create, zt = de.create, Ut = V.create, Ft = ce.create, Bt = H.create, Re = I.create, Wt = N.create, qt = D.create, Jt = I.createWithPreprocess, Yt = he.create, Ht = () => Ue().optional(), Gt = () => Fe().optional(), Qt = () => Be().optional(), Xt = {
|
|
2845
2845
|
string: (r) => C.create({ ...r, coerce: !0 }),
|
|
2846
2846
|
number: (r) => $.create({ ...r, coerce: !0 }),
|
|
2847
2847
|
boolean: (r) => te.create({
|
|
@@ -2904,15 +2904,15 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2904
2904
|
ZodEnum: V,
|
|
2905
2905
|
ZodNativeEnum: ce,
|
|
2906
2906
|
ZodPromise: H,
|
|
2907
|
-
ZodEffects:
|
|
2908
|
-
ZodTransformer:
|
|
2909
|
-
ZodOptional:
|
|
2907
|
+
ZodEffects: I,
|
|
2908
|
+
ZodTransformer: I,
|
|
2909
|
+
ZodOptional: N,
|
|
2910
2910
|
ZodNullable: D,
|
|
2911
2911
|
ZodDefault: ue,
|
|
2912
2912
|
ZodCatch: le,
|
|
2913
2913
|
ZodNaN: xe,
|
|
2914
2914
|
BRAND: yt,
|
|
2915
|
-
ZodBranded:
|
|
2915
|
+
ZodBranded: Ie,
|
|
2916
2916
|
ZodPipeline: he,
|
|
2917
2917
|
ZodReadonly: fe,
|
|
2918
2918
|
custom: ze,
|
|
@@ -2924,7 +2924,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2924
2924
|
},
|
|
2925
2925
|
coerce: Xt,
|
|
2926
2926
|
any: Zt,
|
|
2927
|
-
array:
|
|
2927
|
+
array: It,
|
|
2928
2928
|
bigint: bt,
|
|
2929
2929
|
boolean: Be,
|
|
2930
2930
|
date: xt,
|
|
@@ -2943,7 +2943,7 @@ var d = /* @__PURE__ */ Object.freeze({
|
|
|
2943
2943
|
null: Tt,
|
|
2944
2944
|
nullable: qt,
|
|
2945
2945
|
number: Fe,
|
|
2946
|
-
object:
|
|
2946
|
+
object: Nt,
|
|
2947
2947
|
oboolean: Qt,
|
|
2948
2948
|
onumber: Gt,
|
|
2949
2949
|
optional: Wt,
|
|
@@ -2986,13 +2986,13 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
2986
2986
|
tag: d.string().min(1),
|
|
2987
2987
|
locales: d.array(K),
|
|
2988
2988
|
depth: d.number()
|
|
2989
|
-
}),
|
|
2990
|
-
children: d.lazy(() =>
|
|
2989
|
+
}), Ne = We.extend({
|
|
2990
|
+
children: d.lazy(() => Ne.array())
|
|
2991
2991
|
}), or = We.extend({
|
|
2992
2992
|
index: d.number(),
|
|
2993
2993
|
depth: d.number(),
|
|
2994
2994
|
collapsed: d.boolean().optional(),
|
|
2995
|
-
children: d.array(
|
|
2995
|
+
children: d.array(Ne)
|
|
2996
2996
|
}), G = d.string().min(1), Oe = d.object({
|
|
2997
2997
|
type: d.literal("Product"),
|
|
2998
2998
|
storeId: G,
|
|
@@ -3032,8 +3032,10 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
3032
3032
|
ingredients: d.array(K),
|
|
3033
3033
|
created_at: d.number(),
|
|
3034
3034
|
updated_at: d.number(),
|
|
3035
|
-
|
|
3036
|
-
//
|
|
3035
|
+
categoryIds: d.array(d.string().nonempty()),
|
|
3036
|
+
// @deprecated
|
|
3037
|
+
categoryList: d.array(Ne),
|
|
3038
|
+
// @deprecated
|
|
3037
3039
|
categories: d.object({
|
|
3038
3040
|
lvl0: d.array(d.string()),
|
|
3039
3041
|
lvl1: d.array(d.string()),
|
|
@@ -3041,6 +3043,7 @@ const k = d.string().min(1, { message: "שדה חובה" }), ar = d.string().reg
|
|
|
3041
3043
|
lvl3: d.array(d.string()),
|
|
3042
3044
|
lvl4: d.array(d.string())
|
|
3043
3045
|
}),
|
|
3046
|
+
// @deprecated
|
|
3044
3047
|
categoryNames: d.array(d.string())
|
|
3045
3048
|
}), dr = Oe.extend({
|
|
3046
3049
|
image: d.instanceof(File).optional()
|
|
@@ -3187,7 +3190,7 @@ export {
|
|
|
3187
3190
|
er as AddressSchema,
|
|
3188
3191
|
We as BaseCategorySchema,
|
|
3189
3192
|
cr as CartSchema,
|
|
3190
|
-
|
|
3193
|
+
Ne as CategorySchema,
|
|
3191
3194
|
ur as CompanySchema,
|
|
3192
3195
|
lr as FavoriteProductSchema,
|
|
3193
3196
|
mr as FirebaseAPI,
|