@storm-software/git-tools 2.120.0 → 2.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/{chunk-FEIWTHDN.cjs → chunk-7V324BCR.cjs} +347 -297
- package/bin/{chunk-VATYGW5F.js → chunk-XJZXOYRK.js} +346 -296
- package/bin/git.cjs +143 -99
- package/bin/git.js +73 -29
- package/bin/post-checkout.cjs +9 -9
- package/bin/post-checkout.js +1 -1
- package/bin/post-commit.cjs +9 -9
- package/bin/post-commit.js +1 -1
- package/bin/post-merge.cjs +9 -9
- package/bin/post-merge.js +1 -1
- package/bin/pre-commit.cjs +9 -9
- package/bin/pre-commit.js +1 -1
- package/bin/pre-install.cjs +9 -9
- package/bin/pre-install.js +1 -1
- package/bin/pre-push.cjs +13 -13
- package/bin/pre-push.js +1 -1
- package/bin/prepare.cjs +7 -7
- package/bin/prepare.js +1 -1
- package/bin/version-warning.cjs +5 -5
- package/bin/version-warning.js +1 -1
- package/dist/{chunk-C4NLID2V.js → chunk-25G45MG4.js} +1 -1
- package/dist/{chunk-LSRFGWF5.js → chunk-2IQTQBAX.js} +1 -1
- package/dist/chunk-2RKFQIWE.cjs +19 -0
- package/dist/{chunk-ZE542BCU.cjs → chunk-2SHAD3P5.cjs} +5 -2
- package/dist/{chunk-5XXXTVPU.js → chunk-GRCMQK4Q.js} +5 -2
- package/dist/{chunk-NWZD3QTO.cjs → chunk-RG47FAF4.cjs} +3 -3
- package/dist/commit/minimal.cjs +5 -5
- package/dist/commit/minimal.d.cts +1 -0
- package/dist/commit/minimal.d.ts +1 -0
- package/dist/commit/minimal.js +1 -1
- package/dist/commit/monorepo.cjs +3 -3
- package/dist/commit/monorepo.d.cts +1 -0
- package/dist/commit/monorepo.d.ts +1 -0
- package/dist/commit/monorepo.js +2 -2
- package/dist/commitlint/minimal.cjs +3 -12
- package/dist/commitlint/minimal.d.cts +1 -9
- package/dist/commitlint/minimal.d.ts +1 -9
- package/dist/commitlint/minimal.js +2 -11
- package/dist/commitlint/monorepo.cjs +3 -12
- package/dist/commitlint/monorepo.d.cts +1 -9
- package/dist/commitlint/monorepo.d.ts +1 -9
- package/dist/commitlint/monorepo.js +2 -11
- package/dist/index.cjs +4 -6
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -5
- package/dist/release/config.cjs +3 -3
- package/dist/release/config.d.cts +4 -3
- package/dist/release/config.d.ts +4 -3
- package/dist/release/config.js +2 -2
- package/dist/types.cjs +2 -4
- package/dist/types.d.cts +4 -143
- package/dist/types.d.ts +4 -143
- package/dist/types.js +1 -3
- package/package.json +12 -5
- package/dist/chunk-KD6Y4AJS.cjs +0 -19
|
@@ -22,7 +22,7 @@ var __export = (target, all) => {
|
|
|
22
22
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
25
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__951eea6f126fd84bd771c4f315c150af/node_modules/tsup/assets/cjs_shims.js
|
|
26
26
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
27
27
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
28
28
|
|
|
@@ -381,7 +381,7 @@ function config(newConfig) {
|
|
|
381
381
|
return globalConfig;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
384
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/util.js
|
|
385
385
|
var util_exports = {};
|
|
386
386
|
__export(util_exports, {
|
|
387
387
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -395,11 +395,14 @@ __export(util_exports, {
|
|
|
395
395
|
assertNever: () => assertNever,
|
|
396
396
|
assertNotEqual: () => assertNotEqual,
|
|
397
397
|
assignProp: () => assignProp,
|
|
398
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
399
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
398
400
|
cached: () => cached,
|
|
399
401
|
captureStackTrace: () => captureStackTrace,
|
|
400
402
|
cleanEnum: () => cleanEnum,
|
|
401
403
|
cleanRegex: () => cleanRegex,
|
|
402
404
|
clone: () => clone,
|
|
405
|
+
cloneDef: () => cloneDef,
|
|
403
406
|
createTransparentProxy: () => createTransparentProxy,
|
|
404
407
|
defineLazy: () => defineLazy,
|
|
405
408
|
esc: () => esc,
|
|
@@ -412,15 +415,18 @@ __export(util_exports, {
|
|
|
412
415
|
getLengthableOrigin: () => getLengthableOrigin,
|
|
413
416
|
getParsedType: () => getParsedType,
|
|
414
417
|
getSizableOrigin: () => getSizableOrigin,
|
|
418
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
415
419
|
isObject: () => isObject,
|
|
416
420
|
isPlainObject: () => isPlainObject,
|
|
417
421
|
issue: () => issue,
|
|
418
422
|
joinValues: () => joinValues,
|
|
419
423
|
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
420
424
|
merge: () => merge,
|
|
425
|
+
mergeDefs: () => mergeDefs,
|
|
421
426
|
normalizeParams: () => normalizeParams,
|
|
422
427
|
nullish: () => nullish,
|
|
423
428
|
numKeys: () => numKeys,
|
|
429
|
+
objectClone: () => objectClone,
|
|
424
430
|
omit: () => omit,
|
|
425
431
|
optionalKeys: () => optionalKeys,
|
|
426
432
|
partial: () => partial,
|
|
@@ -431,7 +437,12 @@ __export(util_exports, {
|
|
|
431
437
|
propertyKeyTypes: () => propertyKeyTypes,
|
|
432
438
|
randomString: () => randomString,
|
|
433
439
|
required: () => required,
|
|
440
|
+
safeExtend: () => safeExtend,
|
|
441
|
+
shallowClone: () => shallowClone,
|
|
434
442
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
443
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
444
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
445
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
435
446
|
unwrapMessage: () => unwrapMessage
|
|
436
447
|
});
|
|
437
448
|
function assertEqual(val) {
|
|
@@ -481,20 +492,32 @@ function cleanRegex(source) {
|
|
|
481
492
|
}
|
|
482
493
|
function floatSafeRemainder(val, step) {
|
|
483
494
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
484
|
-
const
|
|
495
|
+
const stepString = step.toString();
|
|
496
|
+
let stepDecCount = (stepString.split(".")[1] || "").length;
|
|
497
|
+
if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
|
|
498
|
+
const match = stepString.match(/\d?e-(\d?)/);
|
|
499
|
+
if (match?.[1]) {
|
|
500
|
+
stepDecCount = Number.parseInt(match[1]);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
485
503
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
486
504
|
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
487
505
|
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
488
506
|
return valInt % stepInt / 10 ** decCount;
|
|
489
507
|
}
|
|
508
|
+
var EVALUATING = Symbol("evaluating");
|
|
490
509
|
function defineLazy(object2, key, getter) {
|
|
510
|
+
let value = void 0;
|
|
491
511
|
Object.defineProperty(object2, key, {
|
|
492
512
|
get() {
|
|
493
|
-
{
|
|
494
|
-
|
|
495
|
-
object2[key] = value;
|
|
496
|
-
return value;
|
|
513
|
+
if (value === EVALUATING) {
|
|
514
|
+
return void 0;
|
|
497
515
|
}
|
|
516
|
+
if (value === void 0) {
|
|
517
|
+
value = EVALUATING;
|
|
518
|
+
value = getter();
|
|
519
|
+
}
|
|
520
|
+
return value;
|
|
498
521
|
},
|
|
499
522
|
set(v) {
|
|
500
523
|
Object.defineProperty(object2, key, {
|
|
@@ -505,6 +528,9 @@ function defineLazy(object2, key, getter) {
|
|
|
505
528
|
configurable: true
|
|
506
529
|
});
|
|
507
530
|
}
|
|
531
|
+
function objectClone(obj) {
|
|
532
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
533
|
+
}
|
|
508
534
|
function assignProp(target, prop, value) {
|
|
509
535
|
Object.defineProperty(target, prop, {
|
|
510
536
|
value,
|
|
@@ -513,6 +539,17 @@ function assignProp(target, prop, value) {
|
|
|
513
539
|
configurable: true
|
|
514
540
|
});
|
|
515
541
|
}
|
|
542
|
+
function mergeDefs(...defs) {
|
|
543
|
+
const mergedDescriptors = {};
|
|
544
|
+
for (const def of defs) {
|
|
545
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
546
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
547
|
+
}
|
|
548
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
549
|
+
}
|
|
550
|
+
function cloneDef(schema) {
|
|
551
|
+
return mergeDefs(schema._zod.def);
|
|
552
|
+
}
|
|
516
553
|
function getElementAtPath(obj, path) {
|
|
517
554
|
if (!path)
|
|
518
555
|
return obj;
|
|
@@ -540,7 +577,7 @@ function randomString(length = 10) {
|
|
|
540
577
|
function esc(str) {
|
|
541
578
|
return JSON.stringify(str);
|
|
542
579
|
}
|
|
543
|
-
var captureStackTrace =
|
|
580
|
+
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
544
581
|
};
|
|
545
582
|
function isObject(data) {
|
|
546
583
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
@@ -571,6 +608,13 @@ function isPlainObject(o) {
|
|
|
571
608
|
}
|
|
572
609
|
return true;
|
|
573
610
|
}
|
|
611
|
+
function shallowClone(o) {
|
|
612
|
+
if (isPlainObject(o))
|
|
613
|
+
return { ...o };
|
|
614
|
+
if (Array.isArray(o))
|
|
615
|
+
return [...o];
|
|
616
|
+
return o;
|
|
617
|
+
}
|
|
574
618
|
function numKeys(data) {
|
|
575
619
|
let keyCount = 0;
|
|
576
620
|
for (const key in data) {
|
|
@@ -708,43 +752,68 @@ var BIGINT_FORMAT_RANGES = {
|
|
|
708
752
|
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
709
753
|
};
|
|
710
754
|
function pick(schema, mask) {
|
|
711
|
-
const newShape = {};
|
|
712
755
|
const currDef = schema._zod.def;
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
756
|
+
const def = mergeDefs(schema._zod.def, {
|
|
757
|
+
get shape() {
|
|
758
|
+
const newShape = {};
|
|
759
|
+
for (const key in mask) {
|
|
760
|
+
if (!(key in currDef.shape)) {
|
|
761
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
762
|
+
}
|
|
763
|
+
if (!mask[key])
|
|
764
|
+
continue;
|
|
765
|
+
newShape[key] = currDef.shape[key];
|
|
766
|
+
}
|
|
767
|
+
assignProp(this, "shape", newShape);
|
|
768
|
+
return newShape;
|
|
769
|
+
},
|
|
724
770
|
checks: []
|
|
725
771
|
});
|
|
772
|
+
return clone(schema, def);
|
|
726
773
|
}
|
|
727
774
|
function omit(schema, mask) {
|
|
728
|
-
const newShape = { ...schema._zod.def.shape };
|
|
729
775
|
const currDef = schema._zod.def;
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
776
|
+
const def = mergeDefs(schema._zod.def, {
|
|
777
|
+
get shape() {
|
|
778
|
+
const newShape = { ...schema._zod.def.shape };
|
|
779
|
+
for (const key in mask) {
|
|
780
|
+
if (!(key in currDef.shape)) {
|
|
781
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
782
|
+
}
|
|
783
|
+
if (!mask[key])
|
|
784
|
+
continue;
|
|
785
|
+
delete newShape[key];
|
|
786
|
+
}
|
|
787
|
+
assignProp(this, "shape", newShape);
|
|
788
|
+
return newShape;
|
|
789
|
+
},
|
|
741
790
|
checks: []
|
|
742
791
|
});
|
|
792
|
+
return clone(schema, def);
|
|
743
793
|
}
|
|
744
794
|
function extend(schema, shape) {
|
|
745
795
|
if (!isPlainObject(shape)) {
|
|
746
796
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
747
797
|
}
|
|
798
|
+
const checks = schema._zod.def.checks;
|
|
799
|
+
const hasChecks = checks && checks.length > 0;
|
|
800
|
+
if (hasChecks) {
|
|
801
|
+
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
802
|
+
}
|
|
803
|
+
const def = mergeDefs(schema._zod.def, {
|
|
804
|
+
get shape() {
|
|
805
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
806
|
+
assignProp(this, "shape", _shape);
|
|
807
|
+
return _shape;
|
|
808
|
+
},
|
|
809
|
+
checks: []
|
|
810
|
+
});
|
|
811
|
+
return clone(schema, def);
|
|
812
|
+
}
|
|
813
|
+
function safeExtend(schema, shape) {
|
|
814
|
+
if (!isPlainObject(shape)) {
|
|
815
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
816
|
+
}
|
|
748
817
|
const def = {
|
|
749
818
|
...schema._zod.def,
|
|
750
819
|
get shape() {
|
|
@@ -752,87 +821,96 @@ function extend(schema, shape) {
|
|
|
752
821
|
assignProp(this, "shape", _shape);
|
|
753
822
|
return _shape;
|
|
754
823
|
},
|
|
755
|
-
checks:
|
|
756
|
-
// delete existing checks
|
|
824
|
+
checks: schema._zod.def.checks
|
|
757
825
|
};
|
|
758
826
|
return clone(schema, def);
|
|
759
827
|
}
|
|
760
828
|
function merge(a, b) {
|
|
761
|
-
|
|
762
|
-
...a._zod.def,
|
|
829
|
+
const def = mergeDefs(a._zod.def, {
|
|
763
830
|
get shape() {
|
|
764
831
|
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
765
832
|
assignProp(this, "shape", _shape);
|
|
766
833
|
return _shape;
|
|
767
834
|
},
|
|
768
|
-
catchall
|
|
835
|
+
get catchall() {
|
|
836
|
+
return b._zod.def.catchall;
|
|
837
|
+
},
|
|
769
838
|
checks: []
|
|
770
839
|
// delete existing checks
|
|
771
840
|
});
|
|
841
|
+
return clone(a, def);
|
|
772
842
|
}
|
|
773
843
|
function partial(Class2, schema, mask) {
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
if (
|
|
779
|
-
|
|
844
|
+
const def = mergeDefs(schema._zod.def, {
|
|
845
|
+
get shape() {
|
|
846
|
+
const oldShape = schema._zod.def.shape;
|
|
847
|
+
const shape = { ...oldShape };
|
|
848
|
+
if (mask) {
|
|
849
|
+
for (const key in mask) {
|
|
850
|
+
if (!(key in oldShape)) {
|
|
851
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
852
|
+
}
|
|
853
|
+
if (!mask[key])
|
|
854
|
+
continue;
|
|
855
|
+
shape[key] = Class2 ? new Class2({
|
|
856
|
+
type: "optional",
|
|
857
|
+
innerType: oldShape[key]
|
|
858
|
+
}) : oldShape[key];
|
|
859
|
+
}
|
|
860
|
+
} else {
|
|
861
|
+
for (const key in oldShape) {
|
|
862
|
+
shape[key] = Class2 ? new Class2({
|
|
863
|
+
type: "optional",
|
|
864
|
+
innerType: oldShape[key]
|
|
865
|
+
}) : oldShape[key];
|
|
866
|
+
}
|
|
780
867
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
type: "optional",
|
|
785
|
-
innerType: oldShape[key]
|
|
786
|
-
}) : oldShape[key];
|
|
787
|
-
}
|
|
788
|
-
} else {
|
|
789
|
-
for (const key in oldShape) {
|
|
790
|
-
shape[key] = Class2 ? new Class2({
|
|
791
|
-
type: "optional",
|
|
792
|
-
innerType: oldShape[key]
|
|
793
|
-
}) : oldShape[key];
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return clone(schema, {
|
|
797
|
-
...schema._zod.def,
|
|
798
|
-
shape,
|
|
868
|
+
assignProp(this, "shape", shape);
|
|
869
|
+
return shape;
|
|
870
|
+
},
|
|
799
871
|
checks: []
|
|
800
872
|
});
|
|
873
|
+
return clone(schema, def);
|
|
801
874
|
}
|
|
802
875
|
function required(Class2, schema, mask) {
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
if (
|
|
808
|
-
|
|
876
|
+
const def = mergeDefs(schema._zod.def, {
|
|
877
|
+
get shape() {
|
|
878
|
+
const oldShape = schema._zod.def.shape;
|
|
879
|
+
const shape = { ...oldShape };
|
|
880
|
+
if (mask) {
|
|
881
|
+
for (const key in mask) {
|
|
882
|
+
if (!(key in shape)) {
|
|
883
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
884
|
+
}
|
|
885
|
+
if (!mask[key])
|
|
886
|
+
continue;
|
|
887
|
+
shape[key] = new Class2({
|
|
888
|
+
type: "nonoptional",
|
|
889
|
+
innerType: oldShape[key]
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
} else {
|
|
893
|
+
for (const key in oldShape) {
|
|
894
|
+
shape[key] = new Class2({
|
|
895
|
+
type: "nonoptional",
|
|
896
|
+
innerType: oldShape[key]
|
|
897
|
+
});
|
|
898
|
+
}
|
|
809
899
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
type: "nonoptional",
|
|
814
|
-
innerType: oldShape[key]
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
} else {
|
|
818
|
-
for (const key in oldShape) {
|
|
819
|
-
shape[key] = new Class2({
|
|
820
|
-
type: "nonoptional",
|
|
821
|
-
innerType: oldShape[key]
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
return clone(schema, {
|
|
826
|
-
...schema._zod.def,
|
|
827
|
-
shape,
|
|
828
|
-
// optional: [],
|
|
900
|
+
assignProp(this, "shape", shape);
|
|
901
|
+
return shape;
|
|
902
|
+
},
|
|
829
903
|
checks: []
|
|
830
904
|
});
|
|
905
|
+
return clone(schema, def);
|
|
831
906
|
}
|
|
832
907
|
function aborted(x, startIndex = 0) {
|
|
908
|
+
if (x.aborted === true)
|
|
909
|
+
return true;
|
|
833
910
|
for (let i = startIndex; i < x.issues.length; i++) {
|
|
834
|
-
if (x.issues[i]?.continue !== true)
|
|
911
|
+
if (x.issues[i]?.continue !== true) {
|
|
835
912
|
return true;
|
|
913
|
+
}
|
|
836
914
|
}
|
|
837
915
|
return false;
|
|
838
916
|
}
|
|
@@ -893,12 +971,49 @@ function cleanEnum(obj) {
|
|
|
893
971
|
return Number.isNaN(Number.parseInt(k, 10));
|
|
894
972
|
}).map((el) => el[1]);
|
|
895
973
|
}
|
|
974
|
+
function base64ToUint8Array(base642) {
|
|
975
|
+
const binaryString = atob(base642);
|
|
976
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
977
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
978
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
979
|
+
}
|
|
980
|
+
return bytes;
|
|
981
|
+
}
|
|
982
|
+
function uint8ArrayToBase64(bytes) {
|
|
983
|
+
let binaryString = "";
|
|
984
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
985
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
986
|
+
}
|
|
987
|
+
return btoa(binaryString);
|
|
988
|
+
}
|
|
989
|
+
function base64urlToUint8Array(base64url2) {
|
|
990
|
+
const base642 = base64url2.replace(/-/g, "+").replace(/_/g, "/");
|
|
991
|
+
const padding = "=".repeat((4 - base642.length % 4) % 4);
|
|
992
|
+
return base64ToUint8Array(base642 + padding);
|
|
993
|
+
}
|
|
994
|
+
function uint8ArrayToBase64url(bytes) {
|
|
995
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
996
|
+
}
|
|
997
|
+
function hexToUint8Array(hex) {
|
|
998
|
+
const cleanHex = hex.replace(/^0x/, "");
|
|
999
|
+
if (cleanHex.length % 2 !== 0) {
|
|
1000
|
+
throw new Error("Invalid hex string length");
|
|
1001
|
+
}
|
|
1002
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1003
|
+
for (let i = 0; i < cleanHex.length; i += 2) {
|
|
1004
|
+
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1005
|
+
}
|
|
1006
|
+
return bytes;
|
|
1007
|
+
}
|
|
1008
|
+
function uint8ArrayToHex(bytes) {
|
|
1009
|
+
return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1010
|
+
}
|
|
896
1011
|
var Class = class {
|
|
897
1012
|
constructor(..._args) {
|
|
898
1013
|
}
|
|
899
1014
|
};
|
|
900
1015
|
|
|
901
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1016
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/errors.js
|
|
902
1017
|
var initializer = (inst, def) => {
|
|
903
1018
|
inst.name = "$ZodError";
|
|
904
1019
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -909,13 +1024,7 @@ var initializer = (inst, def) => {
|
|
|
909
1024
|
value: def,
|
|
910
1025
|
enumerable: false
|
|
911
1026
|
});
|
|
912
|
-
|
|
913
|
-
get() {
|
|
914
|
-
return JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
915
|
-
},
|
|
916
|
-
enumerable: true
|
|
917
|
-
// configurable: false,
|
|
918
|
-
});
|
|
1027
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
919
1028
|
Object.defineProperty(inst, "toString", {
|
|
920
1029
|
value: () => inst.message,
|
|
921
1030
|
enumerable: false
|
|
@@ -924,7 +1033,7 @@ var initializer = (inst, def) => {
|
|
|
924
1033
|
var $ZodError = $constructor("$ZodError", initializer);
|
|
925
1034
|
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
926
1035
|
|
|
927
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1036
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/parse.js
|
|
928
1037
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
929
1038
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
930
1039
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -976,15 +1085,15 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
976
1085
|
};
|
|
977
1086
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
978
1087
|
|
|
979
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
980
|
-
var hostname = /^([a-zA-Z0-9-]
|
|
1088
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/regexes.js
|
|
1089
|
+
var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
|
|
981
1090
|
var string = (params) => {
|
|
982
1091
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
983
1092
|
return new RegExp(`^${regex}$`);
|
|
984
1093
|
};
|
|
985
|
-
var boolean =
|
|
1094
|
+
var boolean = /^(?:true|false)$/i;
|
|
986
1095
|
|
|
987
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1096
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/checks.js
|
|
988
1097
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
989
1098
|
var _a;
|
|
990
1099
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1076,50 +1185,14 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1076
1185
|
};
|
|
1077
1186
|
});
|
|
1078
1187
|
|
|
1079
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1080
|
-
var Doc = class {
|
|
1081
|
-
constructor(args = []) {
|
|
1082
|
-
this.content = [];
|
|
1083
|
-
this.indent = 0;
|
|
1084
|
-
if (this)
|
|
1085
|
-
this.args = args;
|
|
1086
|
-
}
|
|
1087
|
-
indented(fn) {
|
|
1088
|
-
this.indent += 1;
|
|
1089
|
-
fn(this);
|
|
1090
|
-
this.indent -= 1;
|
|
1091
|
-
}
|
|
1092
|
-
write(arg) {
|
|
1093
|
-
if (typeof arg === "function") {
|
|
1094
|
-
arg(this, { execution: "sync" });
|
|
1095
|
-
arg(this, { execution: "async" });
|
|
1096
|
-
return;
|
|
1097
|
-
}
|
|
1098
|
-
const content = arg;
|
|
1099
|
-
const lines = content.split("\n").filter((x) => x);
|
|
1100
|
-
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
1101
|
-
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
1102
|
-
for (const line of dedented) {
|
|
1103
|
-
this.content.push(line);
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
compile() {
|
|
1107
|
-
const F = Function;
|
|
1108
|
-
const args = this?.args;
|
|
1109
|
-
const content = this?.content ?? [``];
|
|
1110
|
-
const lines = [...content.map((x) => ` ${x}`)];
|
|
1111
|
-
return new F(...args, lines.join("\n"));
|
|
1112
|
-
}
|
|
1113
|
-
};
|
|
1114
|
-
|
|
1115
|
-
// ../../node_modules/.pnpm/zod@4.0.5/node_modules/zod/v4/core/versions.js
|
|
1188
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/versions.js
|
|
1116
1189
|
var version = {
|
|
1117
1190
|
major: 4,
|
|
1118
|
-
minor:
|
|
1119
|
-
patch:
|
|
1191
|
+
minor: 1,
|
|
1192
|
+
patch: 8
|
|
1120
1193
|
};
|
|
1121
1194
|
|
|
1122
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1195
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/schemas.js
|
|
1123
1196
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1124
1197
|
var _a;
|
|
1125
1198
|
inst ?? (inst = {});
|
|
@@ -1181,7 +1254,32 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1181
1254
|
}
|
|
1182
1255
|
return payload;
|
|
1183
1256
|
};
|
|
1257
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
1258
|
+
if (aborted(canary)) {
|
|
1259
|
+
canary.aborted = true;
|
|
1260
|
+
return canary;
|
|
1261
|
+
}
|
|
1262
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
1263
|
+
if (checkResult instanceof Promise) {
|
|
1264
|
+
if (ctx.async === false)
|
|
1265
|
+
throw new $ZodAsyncError();
|
|
1266
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
1267
|
+
}
|
|
1268
|
+
return inst._zod.parse(checkResult, ctx);
|
|
1269
|
+
};
|
|
1184
1270
|
inst._zod.run = (payload, ctx) => {
|
|
1271
|
+
if (ctx.skipChecks) {
|
|
1272
|
+
return inst._zod.parse(payload, ctx);
|
|
1273
|
+
}
|
|
1274
|
+
if (ctx.direction === "backward") {
|
|
1275
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
1276
|
+
if (canary instanceof Promise) {
|
|
1277
|
+
return canary.then((canary2) => {
|
|
1278
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
1282
|
+
}
|
|
1185
1283
|
const result = inst._zod.parse(payload, ctx);
|
|
1186
1284
|
if (result instanceof Promise) {
|
|
1187
1285
|
if (ctx.async === false)
|
|
@@ -1232,9 +1330,8 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1232
1330
|
$ZodStringFormat.init(inst, def);
|
|
1233
1331
|
inst._zod.check = (payload) => {
|
|
1234
1332
|
try {
|
|
1235
|
-
const
|
|
1236
|
-
const url2 = new URL(
|
|
1237
|
-
const href = url2.href;
|
|
1333
|
+
const trimmed = payload.value.trim();
|
|
1334
|
+
const url2 = new URL(trimmed);
|
|
1238
1335
|
if (def.hostname) {
|
|
1239
1336
|
def.hostname.lastIndex = 0;
|
|
1240
1337
|
if (!def.hostname.test(url2.hostname)) {
|
|
@@ -1263,10 +1360,10 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
|
1263
1360
|
});
|
|
1264
1361
|
}
|
|
1265
1362
|
}
|
|
1266
|
-
if (
|
|
1267
|
-
payload.value = href
|
|
1363
|
+
if (def.normalize) {
|
|
1364
|
+
payload.value = url2.href;
|
|
1268
1365
|
} else {
|
|
1269
|
-
payload.value =
|
|
1366
|
+
payload.value = trimmed;
|
|
1270
1367
|
}
|
|
1271
1368
|
return;
|
|
1272
1369
|
} catch (_) {
|
|
@@ -1344,48 +1441,70 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
1344
1441
|
return payload;
|
|
1345
1442
|
};
|
|
1346
1443
|
});
|
|
1347
|
-
function
|
|
1444
|
+
function handlePropertyResult(result, final, key, input) {
|
|
1348
1445
|
if (result.issues.length) {
|
|
1349
1446
|
final.issues.push(...prefixIssues(key, result.issues));
|
|
1350
1447
|
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
function handleOptionalObjectResult(result, final, key, input) {
|
|
1354
|
-
if (result.issues.length) {
|
|
1355
|
-
if (input[key] === void 0) {
|
|
1356
|
-
if (key in input) {
|
|
1357
|
-
final.value[key] = void 0;
|
|
1358
|
-
} else {
|
|
1359
|
-
final.value[key] = result.value;
|
|
1360
|
-
}
|
|
1361
|
-
} else {
|
|
1362
|
-
final.issues.push(...prefixIssues(key, result.issues));
|
|
1363
|
-
}
|
|
1364
|
-
} else if (result.value === void 0) {
|
|
1365
|
-
if (key in input)
|
|
1448
|
+
if (result.value === void 0) {
|
|
1449
|
+
if (key in input) {
|
|
1366
1450
|
final.value[key] = void 0;
|
|
1451
|
+
}
|
|
1367
1452
|
} else {
|
|
1368
1453
|
final.value[key] = result.value;
|
|
1369
1454
|
}
|
|
1370
1455
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
if (!(def.shape[k] instanceof $ZodType)) {
|
|
1377
|
-
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1378
|
-
}
|
|
1456
|
+
function normalizeDef(def) {
|
|
1457
|
+
const keys = Object.keys(def.shape);
|
|
1458
|
+
for (const k of keys) {
|
|
1459
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1460
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1379
1461
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1462
|
+
}
|
|
1463
|
+
const okeys = optionalKeys(def.shape);
|
|
1464
|
+
return {
|
|
1465
|
+
...def,
|
|
1466
|
+
keys,
|
|
1467
|
+
keySet: new Set(keys),
|
|
1468
|
+
numKeys: keys.length,
|
|
1469
|
+
optionalKeys: new Set(okeys)
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1473
|
+
const unrecognized = [];
|
|
1474
|
+
const keySet = def.keySet;
|
|
1475
|
+
const _catchall = def.catchall._zod;
|
|
1476
|
+
const t = _catchall.def.type;
|
|
1477
|
+
for (const key of Object.keys(input)) {
|
|
1478
|
+
if (keySet.has(key))
|
|
1479
|
+
continue;
|
|
1480
|
+
if (t === "never") {
|
|
1481
|
+
unrecognized.push(key);
|
|
1482
|
+
continue;
|
|
1483
|
+
}
|
|
1484
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1485
|
+
if (r instanceof Promise) {
|
|
1486
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1487
|
+
} else {
|
|
1488
|
+
handlePropertyResult(r, payload, key, input);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
if (unrecognized.length) {
|
|
1492
|
+
payload.issues.push({
|
|
1493
|
+
code: "unrecognized_keys",
|
|
1494
|
+
keys: unrecognized,
|
|
1495
|
+
input,
|
|
1496
|
+
inst
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
if (!proms.length)
|
|
1500
|
+
return payload;
|
|
1501
|
+
return Promise.all(proms).then(() => {
|
|
1502
|
+
return payload;
|
|
1388
1503
|
});
|
|
1504
|
+
}
|
|
1505
|
+
var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1506
|
+
$ZodType.init(inst, def);
|
|
1507
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
1389
1508
|
defineLazy(inst._zod, "propValues", () => {
|
|
1390
1509
|
const shape = def.shape;
|
|
1391
1510
|
const propValues = {};
|
|
@@ -1399,66 +1518,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1399
1518
|
}
|
|
1400
1519
|
return propValues;
|
|
1401
1520
|
});
|
|
1402
|
-
const generateFastpass = (shape) => {
|
|
1403
|
-
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
1404
|
-
const normalized = _normalized.value;
|
|
1405
|
-
const parseStr = (key) => {
|
|
1406
|
-
const k = esc(key);
|
|
1407
|
-
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1408
|
-
};
|
|
1409
|
-
doc.write(`const input = payload.value;`);
|
|
1410
|
-
const ids = /* @__PURE__ */ Object.create(null);
|
|
1411
|
-
let counter = 0;
|
|
1412
|
-
for (const key of normalized.keys) {
|
|
1413
|
-
ids[key] = `key_${counter++}`;
|
|
1414
|
-
}
|
|
1415
|
-
doc.write(`const newResult = {}`);
|
|
1416
|
-
for (const key of normalized.keys) {
|
|
1417
|
-
if (normalized.optionalKeys.has(key)) {
|
|
1418
|
-
const id = ids[key];
|
|
1419
|
-
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1420
|
-
const k = esc(key);
|
|
1421
|
-
doc.write(`
|
|
1422
|
-
if (${id}.issues.length) {
|
|
1423
|
-
if (input[${k}] === undefined) {
|
|
1424
|
-
if (${k} in input) {
|
|
1425
|
-
newResult[${k}] = undefined;
|
|
1426
|
-
}
|
|
1427
|
-
} else {
|
|
1428
|
-
payload.issues = payload.issues.concat(
|
|
1429
|
-
${id}.issues.map((iss) => ({
|
|
1430
|
-
...iss,
|
|
1431
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}],
|
|
1432
|
-
}))
|
|
1433
|
-
);
|
|
1434
|
-
}
|
|
1435
|
-
} else if (${id}.value === undefined) {
|
|
1436
|
-
if (${k} in input) newResult[${k}] = undefined;
|
|
1437
|
-
} else {
|
|
1438
|
-
newResult[${k}] = ${id}.value;
|
|
1439
|
-
}
|
|
1440
|
-
`);
|
|
1441
|
-
} else {
|
|
1442
|
-
const id = ids[key];
|
|
1443
|
-
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1444
|
-
doc.write(`
|
|
1445
|
-
if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1446
|
-
...iss,
|
|
1447
|
-
path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
|
|
1448
|
-
})));`);
|
|
1449
|
-
doc.write(`newResult[${esc(key)}] = ${id}.value`);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
doc.write(`payload.value = newResult;`);
|
|
1453
|
-
doc.write(`return payload;`);
|
|
1454
|
-
const fn = doc.compile();
|
|
1455
|
-
return (payload, ctx) => fn(shape, payload, ctx);
|
|
1456
|
-
};
|
|
1457
|
-
let fastpass;
|
|
1458
1521
|
const isObject2 = isObject;
|
|
1459
|
-
const jit = !globalConfig.jitless;
|
|
1460
|
-
const allowsEval2 = allowsEval;
|
|
1461
|
-
const fastEnabled = jit && allowsEval2.value;
|
|
1462
1522
|
const catchall = def.catchall;
|
|
1463
1523
|
let value;
|
|
1464
1524
|
inst._zod.parse = (payload, ctx) => {
|
|
@@ -1473,61 +1533,22 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
1473
1533
|
});
|
|
1474
1534
|
return payload;
|
|
1475
1535
|
}
|
|
1536
|
+
payload.value = {};
|
|
1476
1537
|
const proms = [];
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
} else {
|
|
1482
|
-
payload.value = {};
|
|
1483
|
-
const shape = value.shape;
|
|
1484
|
-
for (const key of value.keys) {
|
|
1485
|
-
const el = shape[key];
|
|
1486
|
-
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1487
|
-
const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
|
|
1488
|
-
if (r instanceof Promise) {
|
|
1489
|
-
proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
|
|
1490
|
-
} else if (isOptional) {
|
|
1491
|
-
handleOptionalObjectResult(r, payload, key, input);
|
|
1492
|
-
} else {
|
|
1493
|
-
handleObjectResult(r, payload, key);
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
if (!catchall) {
|
|
1498
|
-
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1499
|
-
}
|
|
1500
|
-
const unrecognized = [];
|
|
1501
|
-
const keySet = value.keySet;
|
|
1502
|
-
const _catchall = catchall._zod;
|
|
1503
|
-
const t = _catchall.def.type;
|
|
1504
|
-
for (const key of Object.keys(input)) {
|
|
1505
|
-
if (keySet.has(key))
|
|
1506
|
-
continue;
|
|
1507
|
-
if (t === "never") {
|
|
1508
|
-
unrecognized.push(key);
|
|
1509
|
-
continue;
|
|
1510
|
-
}
|
|
1511
|
-
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1538
|
+
const shape = value.shape;
|
|
1539
|
+
for (const key of value.keys) {
|
|
1540
|
+
const el = shape[key];
|
|
1541
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1512
1542
|
if (r instanceof Promise) {
|
|
1513
|
-
proms.push(r.then((r2) =>
|
|
1543
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input)));
|
|
1514
1544
|
} else {
|
|
1515
|
-
|
|
1545
|
+
handlePropertyResult(r, payload, key, input);
|
|
1516
1546
|
}
|
|
1517
1547
|
}
|
|
1518
|
-
if (
|
|
1519
|
-
|
|
1520
|
-
code: "unrecognized_keys",
|
|
1521
|
-
keys: unrecognized,
|
|
1522
|
-
input,
|
|
1523
|
-
inst
|
|
1524
|
-
});
|
|
1548
|
+
if (!catchall) {
|
|
1549
|
+
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1525
1550
|
}
|
|
1526
|
-
|
|
1527
|
-
return payload;
|
|
1528
|
-
return Promise.all(proms).then(() => {
|
|
1529
|
-
return payload;
|
|
1530
|
-
});
|
|
1551
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1531
1552
|
};
|
|
1532
1553
|
});
|
|
1533
1554
|
function handleUnionResults(results, final, inst, ctx) {
|
|
@@ -1537,6 +1558,11 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
1537
1558
|
return final;
|
|
1538
1559
|
}
|
|
1539
1560
|
}
|
|
1561
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
1562
|
+
if (nonaborted.length === 1) {
|
|
1563
|
+
final.value = nonaborted[0].value;
|
|
1564
|
+
return nonaborted[0];
|
|
1565
|
+
}
|
|
1540
1566
|
final.issues.push({
|
|
1541
1567
|
code: "invalid_union",
|
|
1542
1568
|
input: final.value,
|
|
@@ -1562,7 +1588,12 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
|
1562
1588
|
}
|
|
1563
1589
|
return void 0;
|
|
1564
1590
|
});
|
|
1591
|
+
const single = def.options.length === 1;
|
|
1592
|
+
const first = def.options[0]._zod.run;
|
|
1565
1593
|
inst._zod.parse = (payload, ctx) => {
|
|
1594
|
+
if (single) {
|
|
1595
|
+
return first(payload, ctx);
|
|
1596
|
+
}
|
|
1566
1597
|
let async = false;
|
|
1567
1598
|
const results = [];
|
|
1568
1599
|
for (const option of def.options) {
|
|
@@ -1647,8 +1678,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
1647
1678
|
}
|
|
1648
1679
|
if (keyResult.issues.length) {
|
|
1649
1680
|
payload.issues.push({
|
|
1650
|
-
origin: "record",
|
|
1651
1681
|
code: "invalid_key",
|
|
1682
|
+
origin: "record",
|
|
1652
1683
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1653
1684
|
input: key,
|
|
1654
1685
|
path: [key],
|
|
@@ -1682,11 +1713,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
1682
1713
|
var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
1683
1714
|
$ZodType.init(inst, def);
|
|
1684
1715
|
const values = getEnumValues(def.entries);
|
|
1685
|
-
|
|
1716
|
+
const valuesSet = new Set(values);
|
|
1717
|
+
inst._zod.values = valuesSet;
|
|
1686
1718
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
1687
1719
|
inst._zod.parse = (payload, _ctx) => {
|
|
1688
1720
|
const input = payload.value;
|
|
1689
|
-
if (
|
|
1721
|
+
if (valuesSet.has(input)) {
|
|
1690
1722
|
return payload;
|
|
1691
1723
|
}
|
|
1692
1724
|
payload.issues.push({
|
|
@@ -1700,8 +1732,11 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
1700
1732
|
});
|
|
1701
1733
|
var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
1702
1734
|
$ZodType.init(inst, def);
|
|
1735
|
+
if (def.values.length === 0) {
|
|
1736
|
+
throw new Error("Cannot create literal schema with no valid values");
|
|
1737
|
+
}
|
|
1703
1738
|
inst._zod.values = new Set(def.values);
|
|
1704
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
|
|
1739
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
1705
1740
|
inst._zod.parse = (payload, _ctx) => {
|
|
1706
1741
|
const input = payload.value;
|
|
1707
1742
|
if (inst._zod.values.has(input)) {
|
|
@@ -1716,6 +1751,12 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
1716
1751
|
return payload;
|
|
1717
1752
|
};
|
|
1718
1753
|
});
|
|
1754
|
+
function handleOptionalResult(result, input) {
|
|
1755
|
+
if (result.issues.length && input === void 0) {
|
|
1756
|
+
return { issues: [], value: void 0 };
|
|
1757
|
+
}
|
|
1758
|
+
return result;
|
|
1759
|
+
}
|
|
1719
1760
|
var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
1720
1761
|
$ZodType.init(inst, def);
|
|
1721
1762
|
inst._zod.optin = "optional";
|
|
@@ -1729,7 +1770,10 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
1729
1770
|
});
|
|
1730
1771
|
inst._zod.parse = (payload, ctx) => {
|
|
1731
1772
|
if (def.innerType._zod.optin === "optional") {
|
|
1732
|
-
|
|
1773
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
1774
|
+
if (result instanceof Promise)
|
|
1775
|
+
return result.then((r) => handleOptionalResult(r, payload.value));
|
|
1776
|
+
return handleOptionalResult(result, payload.value);
|
|
1733
1777
|
}
|
|
1734
1778
|
if (payload.value === void 0) {
|
|
1735
1779
|
return payload;
|
|
@@ -1759,6 +1803,9 @@ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
|
1759
1803
|
inst._zod.optin = "optional";
|
|
1760
1804
|
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
1761
1805
|
inst._zod.parse = (payload, ctx) => {
|
|
1806
|
+
if (ctx.direction === "backward") {
|
|
1807
|
+
return def.innerType._zod.run(payload, ctx);
|
|
1808
|
+
}
|
|
1762
1809
|
if (payload.value === void 0) {
|
|
1763
1810
|
payload.value = def.defaultValue;
|
|
1764
1811
|
return payload;
|
|
@@ -1778,7 +1825,7 @@ function handleDefaultResult(payload, def) {
|
|
|
1778
1825
|
}
|
|
1779
1826
|
var $ZodRegistry = class {
|
|
1780
1827
|
constructor() {
|
|
1781
|
-
this._map = /* @__PURE__ */ new
|
|
1828
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
1782
1829
|
this._idmap = /* @__PURE__ */ new Map();
|
|
1783
1830
|
}
|
|
1784
1831
|
add(schema, ..._meta) {
|
|
@@ -1793,7 +1840,7 @@ var $ZodRegistry = class {
|
|
|
1793
1840
|
return this;
|
|
1794
1841
|
}
|
|
1795
1842
|
clear() {
|
|
1796
|
-
this._map = /* @__PURE__ */ new
|
|
1843
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
1797
1844
|
this._idmap = /* @__PURE__ */ new Map();
|
|
1798
1845
|
return this;
|
|
1799
1846
|
}
|
|
@@ -1810,7 +1857,8 @@ var $ZodRegistry = class {
|
|
|
1810
1857
|
if (p) {
|
|
1811
1858
|
const pm = { ...this.get(p) ?? {} };
|
|
1812
1859
|
delete pm.id;
|
|
1813
|
-
|
|
1860
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
1861
|
+
return Object.keys(f).length ? f : void 0;
|
|
1814
1862
|
}
|
|
1815
1863
|
return this._map.get(schema);
|
|
1816
1864
|
}
|
|
@@ -1822,7 +1870,7 @@ function registry() {
|
|
|
1822
1870
|
return new $ZodRegistry();
|
|
1823
1871
|
}
|
|
1824
1872
|
|
|
1825
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1873
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/core/api.js
|
|
1826
1874
|
function _string(Class2, params) {
|
|
1827
1875
|
return new Class2({
|
|
1828
1876
|
type: "string",
|
|
@@ -1877,12 +1925,13 @@ function _toLowerCase() {
|
|
|
1877
1925
|
return _overwrite((input) => input.toLowerCase());
|
|
1878
1926
|
}
|
|
1879
1927
|
|
|
1880
|
-
// ../../node_modules/.pnpm/zod@4.
|
|
1928
|
+
// ../../node_modules/.pnpm/zod@4.1.8/node_modules/zod/v4/mini/schemas.js
|
|
1881
1929
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
1882
1930
|
if (!inst._zod)
|
|
1883
1931
|
throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1884
1932
|
$ZodType.init(inst, def);
|
|
1885
1933
|
inst.def = def;
|
|
1934
|
+
inst.type = def.type;
|
|
1886
1935
|
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
1887
1936
|
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
1888
1937
|
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
@@ -1991,6 +2040,7 @@ function record(keyType, valueType, params) {
|
|
|
1991
2040
|
var ZodMiniEnum = /* @__PURE__ */ $constructor("ZodMiniEnum", (inst, def) => {
|
|
1992
2041
|
$ZodEnum.init(inst, def);
|
|
1993
2042
|
ZodMiniType.init(inst, def);
|
|
2043
|
+
inst.options = Object.values(def.entries);
|
|
1994
2044
|
});
|
|
1995
2045
|
function _enum(values, params) {
|
|
1996
2046
|
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
@@ -2040,7 +2090,7 @@ function _default(innerType, defaultValue) {
|
|
|
2040
2090
|
type: "default",
|
|
2041
2091
|
innerType,
|
|
2042
2092
|
get defaultValue() {
|
|
2043
|
-
return typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
|
2093
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
2044
2094
|
}
|
|
2045
2095
|
});
|
|
2046
2096
|
}
|