@jsdev_ninja/core 0.13.53 → 0.13.54

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var ot = Object.defineProperty;
2
2
  var ct = (n, e, t) => e in n ? ot(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var $e = (n, e, t) => ct(n, typeof e != "symbol" ? e + "" : e, t);
3
+ var Me = (n, e, t) => ct(n, typeof e != "symbol" ? e + "" : e, t);
4
4
  var x;
5
5
  (function(n) {
6
6
  n.assertEqual = (s) => s;
@@ -37,14 +37,14 @@ var x;
37
37
  }
38
38
  n.joinValues = r, n.jsonStringifyReplacer = (s, i) => typeof i == "bigint" ? i.toString() : i;
39
39
  })(x || (x = {}));
40
- var De;
40
+ var je;
41
41
  (function(n) {
42
42
  n.mergeShapes = (e, t) => ({
43
43
  ...e,
44
44
  ...t
45
45
  // second overwrites first
46
46
  });
47
- })(De || (De = {}));
47
+ })(je || (je = {}));
48
48
  const p = x.arrayToEnum([
49
49
  "string",
50
50
  "nan",
@@ -310,7 +310,7 @@ class T {
310
310
  }
311
311
  const y = Object.freeze({
312
312
  status: "aborted"
313
- }), Y = (n) => ({ status: "dirty", value: n }), S = (n) => ({ status: "valid", value: n }), Oe = (n) => n.status === "aborted", Pe = (n) => n.status === "dirty", q = (n) => n.status === "valid", se = (n) => typeof Promise < "u" && n instanceof Promise;
313
+ }), Y = (n) => ({ status: "dirty", value: n }), S = (n) => ({ status: "valid", value: n }), De = (n) => n.status === "aborted", Oe = (n) => n.status === "dirty", q = (n) => n.status === "valid", se = (n) => typeof Promise < "u" && n instanceof Promise;
314
314
  function be(n, e, t, r) {
315
315
  if (typeof e == "function" ? n !== e || !0 : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
316
316
  return e.get(n);
@@ -332,7 +332,7 @@ class O {
332
332
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
333
333
  }
334
334
  }
335
- const Ve = (n, e) => {
335
+ const $e = (n, e) => {
336
336
  if (q(e))
337
337
  return { success: !0, data: e.value };
338
338
  if (!n.common.issues.length)
@@ -419,7 +419,7 @@ class _ {
419
419
  data: e,
420
420
  parsedType: R(e)
421
421
  }, i = this._parseSync({ data: e, path: s.path, parent: s });
422
- return Ve(s, i);
422
+ return $e(s, i);
423
423
  }
424
424
  "~validate"(e) {
425
425
  var t, r;
@@ -473,7 +473,7 @@ class _ {
473
473
  data: e,
474
474
  parsedType: R(e)
475
475
  }, s = this._parse({ data: e, path: r.path, parent: r }), i = await (se(s) ? s : Promise.resolve(s));
476
- return Ve(r, i);
476
+ return $e(r, i);
477
477
  }
478
478
  refine(e, t) {
479
479
  const r = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
@@ -544,7 +544,7 @@ class _ {
544
544
  });
545
545
  }
546
546
  brand() {
547
- return new Re({
547
+ return new Ee({
548
548
  typeName: g.ZodBranded,
549
549
  type: this,
550
550
  ...v(this._def)
@@ -1960,7 +1960,7 @@ ce.create = (n, e) => new ce({
1960
1960
  typeName: g.ZodUnion,
1961
1961
  ...v(e)
1962
1962
  });
1963
- const E = (n) => n instanceof le ? E(n.schema) : n instanceof Z ? E(n.innerType()) : n instanceof me ? [n.value] : n instanceof F ? n.options : n instanceof pe ? x.objectValues(n.enum) : n instanceof fe ? E(n._def.innerType) : n instanceof ie ? [void 0] : n instanceof oe ? [null] : n instanceof D ? [void 0, ...E(n.unwrap())] : n instanceof U ? [null, ...E(n.unwrap())] : n instanceof Re || n instanceof ge ? E(n.unwrap()) : n instanceof he ? E(n._def.innerType) : [];
1963
+ const E = (n) => n instanceof le ? E(n.schema) : n instanceof Z ? E(n.innerType()) : n instanceof me ? [n.value] : n instanceof F ? n.options : n instanceof pe ? x.objectValues(n.enum) : n instanceof fe ? E(n._def.innerType) : n instanceof ie ? [void 0] : n instanceof oe ? [null] : n instanceof D ? [void 0, ...E(n.unwrap())] : n instanceof U ? [null, ...E(n.unwrap())] : n instanceof Ee || n instanceof ge ? E(n.unwrap()) : n instanceof he ? E(n._def.innerType) : [];
1964
1964
  class Se extends _ {
1965
1965
  _parse(e) {
1966
1966
  const { ctx: t } = this._processInputParams(e);
@@ -2023,14 +2023,14 @@ class Se extends _ {
2023
2023
  });
2024
2024
  }
2025
2025
  }
2026
- function Ee(n, e) {
2026
+ function Pe(n, e) {
2027
2027
  const t = R(n), r = R(e);
2028
2028
  if (n === e)
2029
2029
  return { valid: !0, data: n };
2030
2030
  if (t === p.object && r === p.object) {
2031
2031
  const s = x.objectKeys(e), i = x.objectKeys(n).filter((c) => s.indexOf(c) !== -1), o = { ...n, ...e };
2032
2032
  for (const c of i) {
2033
- const l = Ee(n[c], e[c]);
2033
+ const l = Pe(n[c], e[c]);
2034
2034
  if (!l.valid)
2035
2035
  return { valid: !1 };
2036
2036
  o[c] = l.data;
@@ -2041,7 +2041,7 @@ function Ee(n, e) {
2041
2041
  return { valid: !1 };
2042
2042
  const s = [];
2043
2043
  for (let i = 0; i < n.length; i++) {
2044
- const o = n[i], c = e[i], l = Ee(o, c);
2044
+ const o = n[i], c = e[i], l = Pe(o, c);
2045
2045
  if (!l.valid)
2046
2046
  return { valid: !1 };
2047
2047
  s.push(l.data);
@@ -2052,10 +2052,10 @@ function Ee(n, e) {
2052
2052
  class ue extends _ {
2053
2053
  _parse(e) {
2054
2054
  const { status: t, ctx: r } = this._processInputParams(e), s = (i, o) => {
2055
- if (Oe(i) || Oe(o))
2055
+ if (De(i) || De(o))
2056
2056
  return y;
2057
- const c = Ee(i.value, o.value);
2058
- return c.valid ? ((Pe(i) || Pe(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(r, {
2057
+ const c = Pe(i.value, o.value);
2058
+ return c.valid ? ((Oe(i) || Oe(o)) && t.dirty(), { status: t.value, value: c.data }) : (m(r, {
2059
2059
  code: d.invalid_intersection_types
2060
2060
  }), y);
2061
2061
  };
@@ -2746,7 +2746,7 @@ Te.create = (n) => new Te({
2746
2746
  ...v(n)
2747
2747
  });
2748
2748
  const Ot = Symbol("zod_brand");
2749
- class Re extends _ {
2749
+ class Ee extends _ {
2750
2750
  _parse(e) {
2751
2751
  const { ctx: t } = this._processInputParams(e), r = t.data;
2752
2752
  return this._def.type._parse({
@@ -2813,7 +2813,7 @@ ge.create = (n, e) => new ge({
2813
2813
  typeName: g.ZodReadonly,
2814
2814
  ...v(e)
2815
2815
  });
2816
- function ze(n, e) {
2816
+ function Ve(n, e) {
2817
2817
  const t = typeof n == "function" ? n(e) : typeof n == "string" ? { message: n } : n;
2818
2818
  return typeof t == "string" ? { message: t } : t;
2819
2819
  }
@@ -2825,12 +2825,12 @@ function Ye(n, e = {}, t) {
2825
2825
  return c.then((l) => {
2826
2826
  var u, f;
2827
2827
  if (!l) {
2828
- const b = ze(e, r), w = (f = (u = b.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
2828
+ const b = Ve(e, r), w = (f = (u = b.fatal) !== null && u !== void 0 ? u : t) !== null && f !== void 0 ? f : !0;
2829
2829
  s.addIssue({ code: "custom", ...b, fatal: w });
2830
2830
  }
2831
2831
  });
2832
2832
  if (!c) {
2833
- const l = ze(e, r), u = (o = (i = l.fatal) !== null && i !== void 0 ? i : t) !== null && o !== void 0 ? o : !0;
2833
+ const l = Ve(e, r), u = (o = (i = l.fatal) !== null && i !== void 0 ? i : t) !== null && o !== void 0 ? o : !0;
2834
2834
  s.addIssue({ code: "custom", ...l, fatal: u });
2835
2835
  }
2836
2836
  }) : G.create();
@@ -2844,7 +2844,7 @@ var g;
2844
2844
  })(g || (g = {}));
2845
2845
  const Et = (n, e = {
2846
2846
  message: `Input not instance of ${n.name}`
2847
- }) => Ye((t) => t instanceof n, e), Xe = A.create, Je = V.create, Rt = Te.create, Mt = z.create, Ge = ae.create, $t = B.create, Vt = xe.create, zt = ie.create, Ft = oe.create, Ut = G.create, Lt = L.create, qt = $.create, Bt = ke.create, Wt = C.create, Qt = k.create, Yt = k.strictCreate, Xt = ce.create, Jt = Se.create, Gt = ue.create, Ht = P.create, Kt = de.create, en = we.create, tn = W.create, nn = X.create, rn = le.create, sn = me.create, an = F.create, on = pe.create, cn = H.create, Fe = Z.create, un = D.create, dn = U.create, ln = Z.createWithPreprocess, mn = ye.create, pn = () => Xe().optional(), fn = () => Je().optional(), hn = () => Ge().optional(), gn = {
2847
+ }) => Ye((t) => t instanceof n, e), Xe = A.create, Je = V.create, Rt = Te.create, Mt = z.create, Ge = ae.create, $t = B.create, Vt = xe.create, zt = ie.create, Ft = oe.create, Ut = G.create, Lt = L.create, qt = $.create, Bt = ke.create, Wt = C.create, Qt = k.create, Yt = k.strictCreate, Xt = ce.create, Jt = Se.create, Gt = ue.create, Ht = P.create, Kt = de.create, en = we.create, tn = W.create, nn = X.create, rn = le.create, sn = me.create, an = F.create, on = pe.create, cn = H.create, ze = Z.create, un = D.create, dn = U.create, ln = Z.createWithPreprocess, mn = ye.create, pn = () => Xe().optional(), fn = () => Je().optional(), hn = () => Ge().optional(), gn = {
2848
2848
  string: (n) => A.create({ ...n, coerce: !0 }),
2849
2849
  number: (n) => V.create({ ...n, coerce: !0 }),
2850
2850
  boolean: (n) => ae.create({
@@ -2866,15 +2866,15 @@ var a = /* @__PURE__ */ Object.freeze({
2866
2866
  INVALID: y,
2867
2867
  DIRTY: Y,
2868
2868
  OK: S,
2869
- isAborted: Oe,
2870
- isDirty: Pe,
2869
+ isAborted: De,
2870
+ isDirty: Oe,
2871
2871
  isValid: q,
2872
2872
  isAsync: se,
2873
2873
  get util() {
2874
2874
  return x;
2875
2875
  },
2876
2876
  get objectUtil() {
2877
- return De;
2877
+ return je;
2878
2878
  },
2879
2879
  ZodParsedType: p,
2880
2880
  getParsedType: R,
@@ -2915,7 +2915,7 @@ var a = /* @__PURE__ */ Object.freeze({
2915
2915
  ZodCatch: he,
2916
2916
  ZodNaN: Te,
2917
2917
  BRAND: Ot,
2918
- ZodBranded: Re,
2918
+ ZodBranded: Ee,
2919
2919
  ZodPipeline: ye,
2920
2920
  ZodReadonly: ge,
2921
2921
  custom: Ye,
@@ -2932,7 +2932,7 @@ var a = /* @__PURE__ */ Object.freeze({
2932
2932
  boolean: Ge,
2933
2933
  date: $t,
2934
2934
  discriminatedUnion: Jt,
2935
- effect: Fe,
2935
+ effect: ze,
2936
2936
  enum: an,
2937
2937
  function: nn,
2938
2938
  instanceof: Et,
@@ -2959,7 +2959,7 @@ var a = /* @__PURE__ */ Object.freeze({
2959
2959
  strictObject: Yt,
2960
2960
  string: Xe,
2961
2961
  symbol: Vt,
2962
- transformer: Fe,
2962
+ transformer: ze,
2963
2963
  tuple: Ht,
2964
2964
  undefined: zt,
2965
2965
  union: Xt,
@@ -2993,13 +2993,13 @@ const re = a.object({
2993
2993
  tag: a.string().optional(),
2994
2994
  locales: a.array(re),
2995
2995
  depth: a.number()
2996
- }), Me = He.extend({
2997
- children: a.lazy(() => Me.array())
2996
+ }), Re = He.extend({
2997
+ children: a.lazy(() => Re.array())
2998
2998
  }), Fn = He.extend({
2999
2999
  index: a.number(),
3000
3000
  depth: a.number(),
3001
3001
  collapsed: a.boolean().optional(),
3002
- children: a.array(Me)
3002
+ children: a.array(Re)
3003
3003
  }), ee = a.string().min(1), Ke = a.object({
3004
3004
  type: a.literal("Product"),
3005
3005
  storeId: ee,
@@ -3042,7 +3042,7 @@ const re = a.object({
3042
3042
  updated_at: a.number(),
3043
3043
  categoryIds: a.array(a.string().nonempty()),
3044
3044
  // @deprecated
3045
- categoryList: a.array(Me).optional(),
3045
+ categoryList: a.array(Re).optional(),
3046
3046
  // @deprecated
3047
3047
  categories: a.object({
3048
3048
  lvl0: a.array(a.string()),
@@ -3369,7 +3369,7 @@ class rt {
3369
3369
  this.strategies.clear();
3370
3370
  }
3371
3371
  }
3372
- $e(rt, "strategies", /* @__PURE__ */ new Map([
3372
+ Me(rt, "strategies", /* @__PURE__ */ new Map([
3373
3373
  ["bundle", new Nn()]
3374
3374
  ]));
3375
3375
  class An {
@@ -3496,7 +3496,7 @@ const Cn = a.object({
3496
3496
  newProfitPercentage: a.number()
3497
3497
  })
3498
3498
  )
3499
- }), tr = Zn.omit({ id: !0 }), je = {
3499
+ }), tr = Zn.omit({ id: !0 }), Fe = {
3500
3500
  VAT: 18
3501
3501
  };
3502
3502
  function jn(n) {
@@ -3540,10 +3540,10 @@ function nr({
3540
3540
  if (b.vat) {
3541
3541
  let Ce = 0;
3542
3542
  if (s) {
3543
- const it = I * (je.VAT / (100 + je.VAT));
3543
+ const it = I * (Fe.VAT / 100);
3544
3544
  j = Number(it.toFixed(2)), j = j * w, Ce = Number(j.toFixed(2));
3545
3545
  } else
3546
- j = I * je.VAT / 100, j = j * w, Ce = Number(j.toFixed(2));
3546
+ j = I * Fe.VAT / 100, j = j * w, Ce = Number(j.toFixed(2));
3547
3547
  u.vat = Number((u.vat + Ce).toFixed(2));
3548
3548
  }
3549
3549
  const Ae = Number(I.toFixed(2));
@@ -3606,7 +3606,7 @@ export {
3606
3606
  tt as CalculatedDataSchema,
3607
3607
  et as CartItemProductSchema,
3608
3608
  Ln as CartSchema,
3609
- Me as CategorySchema,
3609
+ Re as CategorySchema,
3610
3610
  qn as CompanySchema,
3611
3611
  bn as DeliveryNoteSchema,
3612
3612
  Sn as DiscountConditionsSchema,