@rolldown/browser 1.0.0-beta.52 → 1.0.0-beta.53
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/cli.mjs +8 -10
- package/dist/config.d.mts +1 -3
- package/dist/config.mjs +6 -9
- package/dist/{constructors-DW3R_Jog.js → constructors-YnYYKXAq.js} +2 -8
- package/dist/experimental-index.browser.mjs +21 -9
- package/dist/experimental-index.d.mts +20 -8
- package/dist/experimental-index.mjs +23 -14
- package/dist/filter-index.d.mts +1 -3
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +6 -9
- package/dist/{normalize-string-or-regex-BcbPUrYo.js → normalize-string-or-regex-BVvsez4S.js} +41 -4
- package/dist/parallel-plugin-worker.mjs +3 -6
- package/dist/parallel-plugin.d.mts +2 -3
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -4
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-CUYnBV3u.js → rolldown-build-DdLgyfGg.js} +332 -184
- package/dist/shared/{binding-BKL2JHoJ.d.mts → binding-CY7Z709f.d.mts} +45 -3
- package/dist/shared/{bindingify-input-options-D4i1DYzt.mjs → bindingify-input-options-DcGFRvkp.mjs} +7 -5
- package/dist/shared/{constructors-XFp0WhK3.mjs → constructors-Bi2whoYR.mjs} +2 -8
- package/dist/shared/{constructors-BvaMwihu.d.mts → constructors-S9gqtBdT.d.mts} +3 -5
- package/dist/shared/{define-config-Buedmg9e.d.mts → define-config-CPSppdHs.d.mts} +2 -2
- package/dist/shared/{load-config-C9CjEv2m.mjs → load-config-B09j7Dnd.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-D1mB67Iy.mjs → normalize-string-or-regex-Bsz_9HAl.mjs} +41 -4
- package/dist/shared/{parse-ast-index-BSDTTjWT.mjs → parse-ast-index-BOAjpcDq.mjs} +1 -1
- package/dist/shared/{rolldown-build-BWJGpMD0.mjs → rolldown-build-CyazSAHY.mjs} +333 -187
- package/dist/shared/{rolldown-0ID0Q4xL.mjs → rolldown-vJGs7rCs.mjs} +1 -1
- package/dist/shared/{utils-DKydZ4iH.d.mts → utils-m9n-gTFq.d.mts} +1 -1
- package/dist/shared/{watch-CwnSQOS4.mjs → watch-Abdexkk9.mjs} +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as augmentCodeLocation, C as LOG_LEVEL_INFO, D as unimplemented, E as arraify, F as logNoFileSystemInBrowser, I as logParseError, L as logPluginError, M as logCycleLoading, N as logInputHookInOutputPlugin, O as unreachable, R as locate, S as LOG_LEVEL_ERROR, T as logLevelPriority, _ as PlainObjectLike, a as bindingifyManifestPlugin, b as normalizeLog, c as collectChangedBundle, d as bindingifySourcemap$1, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, i as bindingifyCSSPostPlugin, j as error, k as unsupported, l as transformToOutputBundle, m as bindingAssetSource, n as BuiltinPlugin, o as bindingifyViteHtmlPlugin, p as __decorate, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_WARN, x as LOG_LEVEL_DEBUG, y as VERSION, z as getCodeFrame } from "./normalize-string-or-regex-BVvsez4S.js";
|
|
2
2
|
import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, parse, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
@@ -709,32 +709,70 @@ function getSortedPlugins(hookName, plugins) {
|
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
//#endregion
|
|
712
|
-
//#region ../../node_modules/.pnpm/valibot@1.
|
|
713
|
-
|
|
712
|
+
//#region ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.3/node_modules/valibot/dist/index.mjs
|
|
713
|
+
let store$4;
|
|
714
|
+
/**
|
|
715
|
+
* Returns the global configuration.
|
|
716
|
+
*
|
|
717
|
+
* @param config The config to merge.
|
|
718
|
+
*
|
|
719
|
+
* @returns The configuration.
|
|
720
|
+
*/
|
|
714
721
|
/* @__NO_SIDE_EFFECTS__ */
|
|
715
|
-
function getGlobalConfig(
|
|
722
|
+
function getGlobalConfig(config$1) {
|
|
716
723
|
return {
|
|
717
|
-
lang:
|
|
718
|
-
message:
|
|
719
|
-
abortEarly:
|
|
720
|
-
abortPipeEarly:
|
|
724
|
+
lang: config$1?.lang ?? store$4?.lang,
|
|
725
|
+
message: config$1?.message,
|
|
726
|
+
abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
|
|
727
|
+
abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
|
|
721
728
|
};
|
|
722
729
|
}
|
|
723
|
-
|
|
730
|
+
let store$3;
|
|
731
|
+
/**
|
|
732
|
+
* Returns a global error message.
|
|
733
|
+
*
|
|
734
|
+
* @param lang The language of the message.
|
|
735
|
+
*
|
|
736
|
+
* @returns The error message.
|
|
737
|
+
*/
|
|
724
738
|
/* @__NO_SIDE_EFFECTS__ */
|
|
725
739
|
function getGlobalMessage(lang) {
|
|
726
|
-
return
|
|
740
|
+
return store$3?.get(lang);
|
|
727
741
|
}
|
|
728
|
-
|
|
742
|
+
let store$2;
|
|
743
|
+
/**
|
|
744
|
+
* Returns a schema error message.
|
|
745
|
+
*
|
|
746
|
+
* @param lang The language of the message.
|
|
747
|
+
*
|
|
748
|
+
* @returns The error message.
|
|
749
|
+
*/
|
|
729
750
|
/* @__NO_SIDE_EFFECTS__ */
|
|
730
751
|
function getSchemaMessage(lang) {
|
|
731
|
-
return
|
|
752
|
+
return store$2?.get(lang);
|
|
732
753
|
}
|
|
733
|
-
|
|
754
|
+
let store$1;
|
|
755
|
+
/**
|
|
756
|
+
* Returns a specific error message.
|
|
757
|
+
*
|
|
758
|
+
* @param reference The identifier reference.
|
|
759
|
+
* @param lang The language of the message.
|
|
760
|
+
*
|
|
761
|
+
* @returns The error message.
|
|
762
|
+
*/
|
|
734
763
|
/* @__NO_SIDE_EFFECTS__ */
|
|
735
764
|
function getSpecificMessage(reference, lang) {
|
|
736
|
-
return
|
|
765
|
+
return store$1?.get(reference)?.get(lang);
|
|
737
766
|
}
|
|
767
|
+
/**
|
|
768
|
+
* Stringifies an unknown input to a literal or type string.
|
|
769
|
+
*
|
|
770
|
+
* @param input The unknown input.
|
|
771
|
+
*
|
|
772
|
+
* @returns A literal or type string.
|
|
773
|
+
*
|
|
774
|
+
* @internal
|
|
775
|
+
*/
|
|
738
776
|
/* @__NO_SIDE_EFFECTS__ */
|
|
739
777
|
function _stringify(input) {
|
|
740
778
|
const type = typeof input;
|
|
@@ -743,7 +781,18 @@ function _stringify(input) {
|
|
|
743
781
|
if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
|
|
744
782
|
return type;
|
|
745
783
|
}
|
|
746
|
-
|
|
784
|
+
/**
|
|
785
|
+
* Adds an issue to the dataset.
|
|
786
|
+
*
|
|
787
|
+
* @param context The issue context.
|
|
788
|
+
* @param label The issue label.
|
|
789
|
+
* @param dataset The input dataset.
|
|
790
|
+
* @param config The configuration.
|
|
791
|
+
* @param other The optional props.
|
|
792
|
+
*
|
|
793
|
+
* @internal
|
|
794
|
+
*/
|
|
795
|
+
function _addIssue(context, label, dataset, config$1, other) {
|
|
747
796
|
const input = other && "input" in other ? other.input : dataset.value;
|
|
748
797
|
const expected = other?.expected ?? context.expects ?? null;
|
|
749
798
|
const received = other?.received ?? /* @__PURE__ */ _stringify(input);
|
|
@@ -757,37 +806,68 @@ function _addIssue(context, label, dataset, config2, other) {
|
|
|
757
806
|
requirement: context.requirement,
|
|
758
807
|
path: other?.path,
|
|
759
808
|
issues: other?.issues,
|
|
760
|
-
lang:
|
|
761
|
-
abortEarly:
|
|
762
|
-
abortPipeEarly:
|
|
809
|
+
lang: config$1.lang,
|
|
810
|
+
abortEarly: config$1.abortEarly,
|
|
811
|
+
abortPipeEarly: config$1.abortPipeEarly
|
|
763
812
|
};
|
|
764
813
|
const isSchema = context.kind === "schema";
|
|
765
|
-
const
|
|
766
|
-
if (
|
|
814
|
+
const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
|
|
815
|
+
if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
|
|
767
816
|
if (isSchema) dataset.typed = false;
|
|
768
817
|
if (dataset.issues) dataset.issues.push(issue);
|
|
769
818
|
else dataset.issues = [issue];
|
|
770
819
|
}
|
|
820
|
+
/**
|
|
821
|
+
* Returns the Standard Schema properties.
|
|
822
|
+
*
|
|
823
|
+
* @param context The schema context.
|
|
824
|
+
*
|
|
825
|
+
* @returns The Standard Schema properties.
|
|
826
|
+
*/
|
|
771
827
|
/* @__NO_SIDE_EFFECTS__ */
|
|
772
828
|
function _getStandardProps(context) {
|
|
773
829
|
return {
|
|
774
830
|
version: 1,
|
|
775
831
|
vendor: "valibot",
|
|
776
|
-
validate(
|
|
777
|
-
return context["~run"]({ value:
|
|
832
|
+
validate(value$1) {
|
|
833
|
+
return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
|
|
778
834
|
}
|
|
779
835
|
};
|
|
780
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Disallows inherited object properties and prevents object prototype
|
|
839
|
+
* pollution by disallowing certain keys.
|
|
840
|
+
*
|
|
841
|
+
* @param object The object to check.
|
|
842
|
+
* @param key The key to check.
|
|
843
|
+
*
|
|
844
|
+
* @returns Whether the key is allowed.
|
|
845
|
+
*
|
|
846
|
+
* @internal
|
|
847
|
+
*/
|
|
781
848
|
/* @__NO_SIDE_EFFECTS__ */
|
|
782
|
-
function _isValidObjectKey(
|
|
783
|
-
return Object.hasOwn(
|
|
849
|
+
function _isValidObjectKey(object$1, key) {
|
|
850
|
+
return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
|
|
784
851
|
}
|
|
852
|
+
/**
|
|
853
|
+
* Joins multiple `expects` values with the given separator.
|
|
854
|
+
*
|
|
855
|
+
* @param values The `expects` values.
|
|
856
|
+
* @param separator The separator.
|
|
857
|
+
*
|
|
858
|
+
* @returns The joined `expects` property.
|
|
859
|
+
*
|
|
860
|
+
* @internal
|
|
861
|
+
*/
|
|
785
862
|
/* @__NO_SIDE_EFFECTS__ */
|
|
786
|
-
function _joinExpects(
|
|
787
|
-
const list = [...new Set(
|
|
863
|
+
function _joinExpects(values$1, separator) {
|
|
864
|
+
const list = [...new Set(values$1)];
|
|
788
865
|
if (list.length > 1) return `(${list.join(` ${separator} `)})`;
|
|
789
866
|
return list[0] ?? "never";
|
|
790
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* A Valibot error with useful information.
|
|
870
|
+
*/
|
|
791
871
|
var ValiError = class extends Error {
|
|
792
872
|
/**
|
|
793
873
|
* Creates a Valibot error with useful information.
|
|
@@ -808,10 +888,10 @@ function args(schema) {
|
|
|
808
888
|
reference: args,
|
|
809
889
|
async: false,
|
|
810
890
|
schema,
|
|
811
|
-
"~run"(dataset,
|
|
891
|
+
"~run"(dataset, config$1) {
|
|
812
892
|
const func = dataset.value;
|
|
813
893
|
dataset.value = (...args_) => {
|
|
814
|
-
const argsDataset = this.schema["~run"]({ value: args_ },
|
|
894
|
+
const argsDataset = this.schema["~run"]({ value: args_ }, config$1);
|
|
815
895
|
if (argsDataset.issues) throw new ValiError(argsDataset.issues);
|
|
816
896
|
return func(...argsDataset.value);
|
|
817
897
|
};
|
|
@@ -819,6 +899,11 @@ function args(schema) {
|
|
|
819
899
|
}
|
|
820
900
|
};
|
|
821
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* Creates an await transformation action.
|
|
904
|
+
*
|
|
905
|
+
* @returns An await action.
|
|
906
|
+
*/
|
|
822
907
|
/* @__NO_SIDE_EFFECTS__ */
|
|
823
908
|
function awaitAsync() {
|
|
824
909
|
return {
|
|
@@ -832,6 +917,13 @@ function awaitAsync() {
|
|
|
832
917
|
}
|
|
833
918
|
};
|
|
834
919
|
}
|
|
920
|
+
/**
|
|
921
|
+
* Creates a description metadata action.
|
|
922
|
+
*
|
|
923
|
+
* @param description_ The description text.
|
|
924
|
+
*
|
|
925
|
+
* @returns A description action.
|
|
926
|
+
*/
|
|
835
927
|
/* @__NO_SIDE_EFFECTS__ */
|
|
836
928
|
function description(description_) {
|
|
837
929
|
return {
|
|
@@ -849,10 +941,10 @@ function returns(schema) {
|
|
|
849
941
|
reference: returns,
|
|
850
942
|
async: false,
|
|
851
943
|
schema,
|
|
852
|
-
"~run"(dataset,
|
|
944
|
+
"~run"(dataset, config$1) {
|
|
853
945
|
const func = dataset.value;
|
|
854
946
|
dataset.value = (...args_) => {
|
|
855
|
-
const returnsDataset = this.schema["~run"]({ value: func(...args_) },
|
|
947
|
+
const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1);
|
|
856
948
|
if (returnsDataset.issues) throw new ValiError(returnsDataset.issues);
|
|
857
949
|
return returnsDataset.value;
|
|
858
950
|
};
|
|
@@ -868,10 +960,10 @@ function returnsAsync(schema) {
|
|
|
868
960
|
reference: returnsAsync,
|
|
869
961
|
async: false,
|
|
870
962
|
schema,
|
|
871
|
-
"~run"(dataset,
|
|
963
|
+
"~run"(dataset, config$1) {
|
|
872
964
|
const func = dataset.value;
|
|
873
965
|
dataset.value = async (...args_) => {
|
|
874
|
-
const returnsDataset = await this.schema["~run"]({ value: await func(...args_) },
|
|
966
|
+
const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1);
|
|
875
967
|
if (returnsDataset.issues) throw new ValiError(returnsDataset.issues);
|
|
876
968
|
return returnsDataset.value;
|
|
877
969
|
};
|
|
@@ -879,14 +971,41 @@ function returnsAsync(schema) {
|
|
|
879
971
|
}
|
|
880
972
|
};
|
|
881
973
|
}
|
|
974
|
+
/**
|
|
975
|
+
* Returns the fallback value of the schema.
|
|
976
|
+
*
|
|
977
|
+
* @param schema The schema to get it from.
|
|
978
|
+
* @param dataset The output dataset if available.
|
|
979
|
+
* @param config The config if available.
|
|
980
|
+
*
|
|
981
|
+
* @returns The fallback value.
|
|
982
|
+
*/
|
|
882
983
|
/* @__NO_SIDE_EFFECTS__ */
|
|
883
|
-
function getFallback(schema, dataset,
|
|
884
|
-
return typeof schema.fallback === "function" ? schema.fallback(dataset,
|
|
984
|
+
function getFallback(schema, dataset, config$1) {
|
|
985
|
+
return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
|
|
885
986
|
}
|
|
987
|
+
/**
|
|
988
|
+
* Returns the default value of the schema.
|
|
989
|
+
*
|
|
990
|
+
* @param schema The schema to get it from.
|
|
991
|
+
* @param dataset The input dataset if available.
|
|
992
|
+
* @param config The config if available.
|
|
993
|
+
*
|
|
994
|
+
* @returns The default value.
|
|
995
|
+
*/
|
|
886
996
|
/* @__NO_SIDE_EFFECTS__ */
|
|
887
|
-
function getDefault(schema, dataset,
|
|
888
|
-
return typeof schema.default === "function" ? schema.default(dataset,
|
|
997
|
+
function getDefault(schema, dataset, config$1) {
|
|
998
|
+
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
889
999
|
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Creates an any schema.
|
|
1002
|
+
*
|
|
1003
|
+
* Hint: This schema function exists only for completeness and is not
|
|
1004
|
+
* recommended in practice. Instead, `unknown` should be used to accept
|
|
1005
|
+
* unknown data.
|
|
1006
|
+
*
|
|
1007
|
+
* @returns An any schema.
|
|
1008
|
+
*/
|
|
890
1009
|
/* @__NO_SIDE_EFFECTS__ */
|
|
891
1010
|
function any() {
|
|
892
1011
|
return {
|
|
@@ -905,7 +1024,7 @@ function any() {
|
|
|
905
1024
|
};
|
|
906
1025
|
}
|
|
907
1026
|
/* @__NO_SIDE_EFFECTS__ */
|
|
908
|
-
function array(item,
|
|
1027
|
+
function array(item, message$1) {
|
|
909
1028
|
return {
|
|
910
1029
|
kind: "schema",
|
|
911
1030
|
type: "array",
|
|
@@ -913,25 +1032,25 @@ function array(item, message2) {
|
|
|
913
1032
|
expects: "Array",
|
|
914
1033
|
async: false,
|
|
915
1034
|
item,
|
|
916
|
-
message:
|
|
1035
|
+
message: message$1,
|
|
917
1036
|
get "~standard"() {
|
|
918
1037
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
919
1038
|
},
|
|
920
|
-
"~run"(dataset,
|
|
1039
|
+
"~run"(dataset, config$1) {
|
|
921
1040
|
const input = dataset.value;
|
|
922
1041
|
if (Array.isArray(input)) {
|
|
923
1042
|
dataset.typed = true;
|
|
924
1043
|
dataset.value = [];
|
|
925
1044
|
for (let key = 0; key < input.length; key++) {
|
|
926
|
-
const
|
|
927
|
-
const itemDataset = this.item["~run"]({ value:
|
|
1045
|
+
const value$1 = input[key];
|
|
1046
|
+
const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
|
|
928
1047
|
if (itemDataset.issues) {
|
|
929
1048
|
const pathItem = {
|
|
930
1049
|
type: "array",
|
|
931
1050
|
origin: "value",
|
|
932
1051
|
input,
|
|
933
1052
|
key,
|
|
934
|
-
value:
|
|
1053
|
+
value: value$1
|
|
935
1054
|
};
|
|
936
1055
|
for (const issue of itemDataset.issues) {
|
|
937
1056
|
if (issue.path) issue.path.unshift(pathItem);
|
|
@@ -939,7 +1058,7 @@ function array(item, message2) {
|
|
|
939
1058
|
dataset.issues?.push(issue);
|
|
940
1059
|
}
|
|
941
1060
|
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
942
|
-
if (
|
|
1061
|
+
if (config$1.abortEarly) {
|
|
943
1062
|
dataset.typed = false;
|
|
944
1063
|
break;
|
|
945
1064
|
}
|
|
@@ -947,71 +1066,71 @@ function array(item, message2) {
|
|
|
947
1066
|
if (!itemDataset.typed) dataset.typed = false;
|
|
948
1067
|
dataset.value.push(itemDataset.value);
|
|
949
1068
|
}
|
|
950
|
-
} else _addIssue(this, "type", dataset,
|
|
1069
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
951
1070
|
return dataset;
|
|
952
1071
|
}
|
|
953
1072
|
};
|
|
954
1073
|
}
|
|
955
1074
|
/* @__NO_SIDE_EFFECTS__ */
|
|
956
|
-
function boolean(
|
|
1075
|
+
function boolean(message$1) {
|
|
957
1076
|
return {
|
|
958
1077
|
kind: "schema",
|
|
959
1078
|
type: "boolean",
|
|
960
1079
|
reference: boolean,
|
|
961
1080
|
expects: "boolean",
|
|
962
1081
|
async: false,
|
|
963
|
-
message:
|
|
1082
|
+
message: message$1,
|
|
964
1083
|
get "~standard"() {
|
|
965
1084
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
966
1085
|
},
|
|
967
|
-
"~run"(dataset,
|
|
1086
|
+
"~run"(dataset, config$1) {
|
|
968
1087
|
if (typeof dataset.value === "boolean") dataset.typed = true;
|
|
969
|
-
else _addIssue(this, "type", dataset,
|
|
1088
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
970
1089
|
return dataset;
|
|
971
1090
|
}
|
|
972
1091
|
};
|
|
973
1092
|
}
|
|
974
1093
|
/* @__NO_SIDE_EFFECTS__ */
|
|
975
|
-
function custom(
|
|
1094
|
+
function custom(check$1, message$1) {
|
|
976
1095
|
return {
|
|
977
1096
|
kind: "schema",
|
|
978
1097
|
type: "custom",
|
|
979
1098
|
reference: custom,
|
|
980
1099
|
expects: "unknown",
|
|
981
1100
|
async: false,
|
|
982
|
-
check:
|
|
983
|
-
message:
|
|
1101
|
+
check: check$1,
|
|
1102
|
+
message: message$1,
|
|
984
1103
|
get "~standard"() {
|
|
985
1104
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
986
1105
|
},
|
|
987
|
-
"~run"(dataset,
|
|
1106
|
+
"~run"(dataset, config$1) {
|
|
988
1107
|
if (this.check(dataset.value)) dataset.typed = true;
|
|
989
|
-
else _addIssue(this, "type", dataset,
|
|
1108
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
990
1109
|
return dataset;
|
|
991
1110
|
}
|
|
992
1111
|
};
|
|
993
1112
|
}
|
|
994
1113
|
/* @__NO_SIDE_EFFECTS__ */
|
|
995
|
-
function function_(
|
|
1114
|
+
function function_(message$1) {
|
|
996
1115
|
return {
|
|
997
1116
|
kind: "schema",
|
|
998
1117
|
type: "function",
|
|
999
1118
|
reference: function_,
|
|
1000
1119
|
expects: "Function",
|
|
1001
1120
|
async: false,
|
|
1002
|
-
message:
|
|
1121
|
+
message: message$1,
|
|
1003
1122
|
get "~standard"() {
|
|
1004
1123
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1005
1124
|
},
|
|
1006
|
-
"~run"(dataset,
|
|
1125
|
+
"~run"(dataset, config$1) {
|
|
1007
1126
|
if (typeof dataset.value === "function") dataset.typed = true;
|
|
1008
|
-
else _addIssue(this, "type", dataset,
|
|
1127
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1009
1128
|
return dataset;
|
|
1010
1129
|
}
|
|
1011
1130
|
};
|
|
1012
1131
|
}
|
|
1013
1132
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1014
|
-
function instance(class_,
|
|
1133
|
+
function instance(class_, message$1) {
|
|
1015
1134
|
return {
|
|
1016
1135
|
kind: "schema",
|
|
1017
1136
|
type: "instance",
|
|
@@ -1019,19 +1138,19 @@ function instance(class_, message2) {
|
|
|
1019
1138
|
expects: class_.name,
|
|
1020
1139
|
async: false,
|
|
1021
1140
|
class: class_,
|
|
1022
|
-
message:
|
|
1141
|
+
message: message$1,
|
|
1023
1142
|
get "~standard"() {
|
|
1024
1143
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1025
1144
|
},
|
|
1026
|
-
"~run"(dataset,
|
|
1145
|
+
"~run"(dataset, config$1) {
|
|
1027
1146
|
if (dataset.value instanceof this.class) dataset.typed = true;
|
|
1028
|
-
else _addIssue(this, "type", dataset,
|
|
1147
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1029
1148
|
return dataset;
|
|
1030
1149
|
}
|
|
1031
1150
|
};
|
|
1032
1151
|
}
|
|
1033
1152
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1034
|
-
function literal(literal_,
|
|
1153
|
+
function literal(literal_, message$1) {
|
|
1035
1154
|
return {
|
|
1036
1155
|
kind: "schema",
|
|
1037
1156
|
type: "literal",
|
|
@@ -1039,31 +1158,31 @@ function literal(literal_, message2) {
|
|
|
1039
1158
|
expects: /* @__PURE__ */ _stringify(literal_),
|
|
1040
1159
|
async: false,
|
|
1041
1160
|
literal: literal_,
|
|
1042
|
-
message:
|
|
1161
|
+
message: message$1,
|
|
1043
1162
|
get "~standard"() {
|
|
1044
1163
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1045
1164
|
},
|
|
1046
|
-
"~run"(dataset,
|
|
1165
|
+
"~run"(dataset, config$1) {
|
|
1047
1166
|
if (dataset.value === this.literal) dataset.typed = true;
|
|
1048
|
-
else _addIssue(this, "type", dataset,
|
|
1167
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1049
1168
|
return dataset;
|
|
1050
1169
|
}
|
|
1051
1170
|
};
|
|
1052
1171
|
}
|
|
1053
1172
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1054
|
-
function looseObject(
|
|
1173
|
+
function looseObject(entries$1, message$1) {
|
|
1055
1174
|
return {
|
|
1056
1175
|
kind: "schema",
|
|
1057
1176
|
type: "loose_object",
|
|
1058
1177
|
reference: looseObject,
|
|
1059
1178
|
expects: "Object",
|
|
1060
1179
|
async: false,
|
|
1061
|
-
entries:
|
|
1062
|
-
message:
|
|
1180
|
+
entries: entries$1,
|
|
1181
|
+
message: message$1,
|
|
1063
1182
|
get "~standard"() {
|
|
1064
1183
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1065
1184
|
},
|
|
1066
|
-
"~run"(dataset,
|
|
1185
|
+
"~run"(dataset, config$1) {
|
|
1067
1186
|
const input = dataset.value;
|
|
1068
1187
|
if (input && typeof input === "object") {
|
|
1069
1188
|
dataset.typed = true;
|
|
@@ -1071,15 +1190,15 @@ function looseObject(entries2, message2) {
|
|
|
1071
1190
|
for (const key in this.entries) {
|
|
1072
1191
|
const valueSchema = this.entries[key];
|
|
1073
1192
|
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1074
|
-
const
|
|
1075
|
-
const valueDataset = valueSchema["~run"]({ value:
|
|
1193
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1194
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1076
1195
|
if (valueDataset.issues) {
|
|
1077
1196
|
const pathItem = {
|
|
1078
1197
|
type: "object",
|
|
1079
1198
|
origin: "value",
|
|
1080
1199
|
input,
|
|
1081
1200
|
key,
|
|
1082
|
-
value:
|
|
1201
|
+
value: value$1
|
|
1083
1202
|
};
|
|
1084
1203
|
for (const issue of valueDataset.issues) {
|
|
1085
1204
|
if (issue.path) issue.path.unshift(pathItem);
|
|
@@ -1087,7 +1206,7 @@ function looseObject(entries2, message2) {
|
|
|
1087
1206
|
dataset.issues?.push(issue);
|
|
1088
1207
|
}
|
|
1089
1208
|
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1090
|
-
if (
|
|
1209
|
+
if (config$1.abortEarly) {
|
|
1091
1210
|
dataset.typed = false;
|
|
1092
1211
|
break;
|
|
1093
1212
|
}
|
|
@@ -1096,7 +1215,7 @@ function looseObject(entries2, message2) {
|
|
|
1096
1215
|
dataset.value[key] = valueDataset.value;
|
|
1097
1216
|
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1098
1217
|
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1099
|
-
_addIssue(this, "key", dataset,
|
|
1218
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1100
1219
|
input: void 0,
|
|
1101
1220
|
expected: `"${key}"`,
|
|
1102
1221
|
path: [{
|
|
@@ -1107,31 +1226,31 @@ function looseObject(entries2, message2) {
|
|
|
1107
1226
|
value: input[key]
|
|
1108
1227
|
}]
|
|
1109
1228
|
});
|
|
1110
|
-
if (
|
|
1229
|
+
if (config$1.abortEarly) break;
|
|
1111
1230
|
}
|
|
1112
1231
|
}
|
|
1113
|
-
if (!dataset.issues || !
|
|
1232
|
+
if (!dataset.issues || !config$1.abortEarly) {
|
|
1114
1233
|
for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1115
1234
|
}
|
|
1116
|
-
} else _addIssue(this, "type", dataset,
|
|
1235
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1117
1236
|
return dataset;
|
|
1118
1237
|
}
|
|
1119
1238
|
};
|
|
1120
1239
|
}
|
|
1121
1240
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1122
|
-
function never(
|
|
1241
|
+
function never(message$1) {
|
|
1123
1242
|
return {
|
|
1124
1243
|
kind: "schema",
|
|
1125
1244
|
type: "never",
|
|
1126
1245
|
reference: never,
|
|
1127
1246
|
expects: "never",
|
|
1128
1247
|
async: false,
|
|
1129
|
-
message:
|
|
1248
|
+
message: message$1,
|
|
1130
1249
|
get "~standard"() {
|
|
1131
1250
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1132
1251
|
},
|
|
1133
|
-
"~run"(dataset,
|
|
1134
|
-
_addIssue(this, "type", dataset,
|
|
1252
|
+
"~run"(dataset, config$1) {
|
|
1253
|
+
_addIssue(this, "type", dataset, config$1);
|
|
1135
1254
|
return dataset;
|
|
1136
1255
|
}
|
|
1137
1256
|
};
|
|
@@ -1149,51 +1268,51 @@ function nullish(wrapped, default_) {
|
|
|
1149
1268
|
get "~standard"() {
|
|
1150
1269
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1151
1270
|
},
|
|
1152
|
-
"~run"(dataset,
|
|
1271
|
+
"~run"(dataset, config$1) {
|
|
1153
1272
|
if (dataset.value === null || dataset.value === void 0) {
|
|
1154
|
-
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset,
|
|
1273
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
1155
1274
|
if (dataset.value === null || dataset.value === void 0) {
|
|
1156
1275
|
dataset.typed = true;
|
|
1157
1276
|
return dataset;
|
|
1158
1277
|
}
|
|
1159
1278
|
}
|
|
1160
|
-
return this.wrapped["~run"](dataset,
|
|
1279
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
1161
1280
|
}
|
|
1162
1281
|
};
|
|
1163
1282
|
}
|
|
1164
1283
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1165
|
-
function number(
|
|
1284
|
+
function number(message$1) {
|
|
1166
1285
|
return {
|
|
1167
1286
|
kind: "schema",
|
|
1168
1287
|
type: "number",
|
|
1169
1288
|
reference: number,
|
|
1170
1289
|
expects: "number",
|
|
1171
1290
|
async: false,
|
|
1172
|
-
message:
|
|
1291
|
+
message: message$1,
|
|
1173
1292
|
get "~standard"() {
|
|
1174
1293
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1175
1294
|
},
|
|
1176
|
-
"~run"(dataset,
|
|
1295
|
+
"~run"(dataset, config$1) {
|
|
1177
1296
|
if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
|
|
1178
|
-
else _addIssue(this, "type", dataset,
|
|
1297
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1179
1298
|
return dataset;
|
|
1180
1299
|
}
|
|
1181
1300
|
};
|
|
1182
1301
|
}
|
|
1183
1302
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1184
|
-
function object(
|
|
1303
|
+
function object(entries$1, message$1) {
|
|
1185
1304
|
return {
|
|
1186
1305
|
kind: "schema",
|
|
1187
1306
|
type: "object",
|
|
1188
1307
|
reference: object,
|
|
1189
1308
|
expects: "Object",
|
|
1190
1309
|
async: false,
|
|
1191
|
-
entries:
|
|
1192
|
-
message:
|
|
1310
|
+
entries: entries$1,
|
|
1311
|
+
message: message$1,
|
|
1193
1312
|
get "~standard"() {
|
|
1194
1313
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1195
1314
|
},
|
|
1196
|
-
"~run"(dataset,
|
|
1315
|
+
"~run"(dataset, config$1) {
|
|
1197
1316
|
const input = dataset.value;
|
|
1198
1317
|
if (input && typeof input === "object") {
|
|
1199
1318
|
dataset.typed = true;
|
|
@@ -1201,15 +1320,15 @@ function object(entries2, message2) {
|
|
|
1201
1320
|
for (const key in this.entries) {
|
|
1202
1321
|
const valueSchema = this.entries[key];
|
|
1203
1322
|
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1204
|
-
const
|
|
1205
|
-
const valueDataset = valueSchema["~run"]({ value:
|
|
1323
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1324
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1206
1325
|
if (valueDataset.issues) {
|
|
1207
1326
|
const pathItem = {
|
|
1208
1327
|
type: "object",
|
|
1209
1328
|
origin: "value",
|
|
1210
1329
|
input,
|
|
1211
1330
|
key,
|
|
1212
|
-
value:
|
|
1331
|
+
value: value$1
|
|
1213
1332
|
};
|
|
1214
1333
|
for (const issue of valueDataset.issues) {
|
|
1215
1334
|
if (issue.path) issue.path.unshift(pathItem);
|
|
@@ -1217,7 +1336,7 @@ function object(entries2, message2) {
|
|
|
1217
1336
|
dataset.issues?.push(issue);
|
|
1218
1337
|
}
|
|
1219
1338
|
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1220
|
-
if (
|
|
1339
|
+
if (config$1.abortEarly) {
|
|
1221
1340
|
dataset.typed = false;
|
|
1222
1341
|
break;
|
|
1223
1342
|
}
|
|
@@ -1226,7 +1345,7 @@ function object(entries2, message2) {
|
|
|
1226
1345
|
dataset.value[key] = valueDataset.value;
|
|
1227
1346
|
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1228
1347
|
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1229
|
-
_addIssue(this, "key", dataset,
|
|
1348
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1230
1349
|
input: void 0,
|
|
1231
1350
|
expected: `"${key}"`,
|
|
1232
1351
|
path: [{
|
|
@@ -1237,10 +1356,10 @@ function object(entries2, message2) {
|
|
|
1237
1356
|
value: input[key]
|
|
1238
1357
|
}]
|
|
1239
1358
|
});
|
|
1240
|
-
if (
|
|
1359
|
+
if (config$1.abortEarly) break;
|
|
1241
1360
|
}
|
|
1242
1361
|
}
|
|
1243
|
-
} else _addIssue(this, "type", dataset,
|
|
1362
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1244
1363
|
return dataset;
|
|
1245
1364
|
}
|
|
1246
1365
|
};
|
|
@@ -1258,39 +1377,39 @@ function optional(wrapped, default_) {
|
|
|
1258
1377
|
get "~standard"() {
|
|
1259
1378
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1260
1379
|
},
|
|
1261
|
-
"~run"(dataset,
|
|
1380
|
+
"~run"(dataset, config$1) {
|
|
1262
1381
|
if (dataset.value === void 0) {
|
|
1263
|
-
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset,
|
|
1382
|
+
if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
|
|
1264
1383
|
if (dataset.value === void 0) {
|
|
1265
1384
|
dataset.typed = true;
|
|
1266
1385
|
return dataset;
|
|
1267
1386
|
}
|
|
1268
1387
|
}
|
|
1269
|
-
return this.wrapped["~run"](dataset,
|
|
1388
|
+
return this.wrapped["~run"](dataset, config$1);
|
|
1270
1389
|
}
|
|
1271
1390
|
};
|
|
1272
1391
|
}
|
|
1273
1392
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1274
|
-
function promise(
|
|
1393
|
+
function promise(message$1) {
|
|
1275
1394
|
return {
|
|
1276
1395
|
kind: "schema",
|
|
1277
1396
|
type: "promise",
|
|
1278
1397
|
reference: promise,
|
|
1279
1398
|
expects: "Promise",
|
|
1280
1399
|
async: false,
|
|
1281
|
-
message:
|
|
1400
|
+
message: message$1,
|
|
1282
1401
|
get "~standard"() {
|
|
1283
1402
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1284
1403
|
},
|
|
1285
|
-
"~run"(dataset,
|
|
1404
|
+
"~run"(dataset, config$1) {
|
|
1286
1405
|
if (dataset.value instanceof Promise) dataset.typed = true;
|
|
1287
|
-
else _addIssue(this, "type", dataset,
|
|
1406
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1288
1407
|
return dataset;
|
|
1289
1408
|
}
|
|
1290
1409
|
};
|
|
1291
1410
|
}
|
|
1292
1411
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1293
|
-
function record(key,
|
|
1412
|
+
function record(key, value$1, message$1) {
|
|
1294
1413
|
return {
|
|
1295
1414
|
kind: "schema",
|
|
1296
1415
|
type: "record",
|
|
@@ -1298,19 +1417,19 @@ function record(key, value2, message2) {
|
|
|
1298
1417
|
expects: "Object",
|
|
1299
1418
|
async: false,
|
|
1300
1419
|
key,
|
|
1301
|
-
value:
|
|
1302
|
-
message:
|
|
1420
|
+
value: value$1,
|
|
1421
|
+
message: message$1,
|
|
1303
1422
|
get "~standard"() {
|
|
1304
1423
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1305
1424
|
},
|
|
1306
|
-
"~run"(dataset,
|
|
1425
|
+
"~run"(dataset, config$1) {
|
|
1307
1426
|
const input = dataset.value;
|
|
1308
1427
|
if (input && typeof input === "object") {
|
|
1309
1428
|
dataset.typed = true;
|
|
1310
1429
|
dataset.value = {};
|
|
1311
1430
|
for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
|
|
1312
1431
|
const entryValue = input[entryKey];
|
|
1313
|
-
const keyDataset = this.key["~run"]({ value: entryKey },
|
|
1432
|
+
const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
|
|
1314
1433
|
if (keyDataset.issues) {
|
|
1315
1434
|
const pathItem = {
|
|
1316
1435
|
type: "object",
|
|
@@ -1324,12 +1443,12 @@ function record(key, value2, message2) {
|
|
|
1324
1443
|
dataset.issues?.push(issue);
|
|
1325
1444
|
}
|
|
1326
1445
|
if (!dataset.issues) dataset.issues = keyDataset.issues;
|
|
1327
|
-
if (
|
|
1446
|
+
if (config$1.abortEarly) {
|
|
1328
1447
|
dataset.typed = false;
|
|
1329
1448
|
break;
|
|
1330
1449
|
}
|
|
1331
1450
|
}
|
|
1332
|
-
const valueDataset = this.value["~run"]({ value: entryValue },
|
|
1451
|
+
const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
|
|
1333
1452
|
if (valueDataset.issues) {
|
|
1334
1453
|
const pathItem = {
|
|
1335
1454
|
type: "object",
|
|
@@ -1344,7 +1463,7 @@ function record(key, value2, message2) {
|
|
|
1344
1463
|
dataset.issues?.push(issue);
|
|
1345
1464
|
}
|
|
1346
1465
|
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1347
|
-
if (
|
|
1466
|
+
if (config$1.abortEarly) {
|
|
1348
1467
|
dataset.typed = false;
|
|
1349
1468
|
break;
|
|
1350
1469
|
}
|
|
@@ -1352,25 +1471,25 @@ function record(key, value2, message2) {
|
|
|
1352
1471
|
if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
|
|
1353
1472
|
if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
|
|
1354
1473
|
}
|
|
1355
|
-
} else _addIssue(this, "type", dataset,
|
|
1474
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1356
1475
|
return dataset;
|
|
1357
1476
|
}
|
|
1358
1477
|
};
|
|
1359
1478
|
}
|
|
1360
1479
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1361
|
-
function strictObject(
|
|
1480
|
+
function strictObject(entries$1, message$1) {
|
|
1362
1481
|
return {
|
|
1363
1482
|
kind: "schema",
|
|
1364
1483
|
type: "strict_object",
|
|
1365
1484
|
reference: strictObject,
|
|
1366
1485
|
expects: "Object",
|
|
1367
1486
|
async: false,
|
|
1368
|
-
entries:
|
|
1369
|
-
message:
|
|
1487
|
+
entries: entries$1,
|
|
1488
|
+
message: message$1,
|
|
1370
1489
|
get "~standard"() {
|
|
1371
1490
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1372
1491
|
},
|
|
1373
|
-
"~run"(dataset,
|
|
1492
|
+
"~run"(dataset, config$1) {
|
|
1374
1493
|
const input = dataset.value;
|
|
1375
1494
|
if (input && typeof input === "object") {
|
|
1376
1495
|
dataset.typed = true;
|
|
@@ -1378,15 +1497,15 @@ function strictObject(entries2, message2) {
|
|
|
1378
1497
|
for (const key in this.entries) {
|
|
1379
1498
|
const valueSchema = this.entries[key];
|
|
1380
1499
|
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1381
|
-
const
|
|
1382
|
-
const valueDataset = valueSchema["~run"]({ value:
|
|
1500
|
+
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1501
|
+
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1383
1502
|
if (valueDataset.issues) {
|
|
1384
1503
|
const pathItem = {
|
|
1385
1504
|
type: "object",
|
|
1386
1505
|
origin: "value",
|
|
1387
1506
|
input,
|
|
1388
1507
|
key,
|
|
1389
|
-
value:
|
|
1508
|
+
value: value$1
|
|
1390
1509
|
};
|
|
1391
1510
|
for (const issue of valueDataset.issues) {
|
|
1392
1511
|
if (issue.path) issue.path.unshift(pathItem);
|
|
@@ -1394,7 +1513,7 @@ function strictObject(entries2, message2) {
|
|
|
1394
1513
|
dataset.issues?.push(issue);
|
|
1395
1514
|
}
|
|
1396
1515
|
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1397
|
-
if (
|
|
1516
|
+
if (config$1.abortEarly) {
|
|
1398
1517
|
dataset.typed = false;
|
|
1399
1518
|
break;
|
|
1400
1519
|
}
|
|
@@ -1403,7 +1522,7 @@ function strictObject(entries2, message2) {
|
|
|
1403
1522
|
dataset.value[key] = valueDataset.value;
|
|
1404
1523
|
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1405
1524
|
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1406
|
-
_addIssue(this, "key", dataset,
|
|
1525
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1407
1526
|
input: void 0,
|
|
1408
1527
|
expected: `"${key}"`,
|
|
1409
1528
|
path: [{
|
|
@@ -1414,12 +1533,12 @@ function strictObject(entries2, message2) {
|
|
|
1414
1533
|
value: input[key]
|
|
1415
1534
|
}]
|
|
1416
1535
|
});
|
|
1417
|
-
if (
|
|
1536
|
+
if (config$1.abortEarly) break;
|
|
1418
1537
|
}
|
|
1419
1538
|
}
|
|
1420
|
-
if (!dataset.issues || !
|
|
1539
|
+
if (!dataset.issues || !config$1.abortEarly) {
|
|
1421
1540
|
for (const key in input) if (!(key in this.entries)) {
|
|
1422
|
-
_addIssue(this, "key", dataset,
|
|
1541
|
+
_addIssue(this, "key", dataset, config$1, {
|
|
1423
1542
|
input: key,
|
|
1424
1543
|
expected: "never",
|
|
1425
1544
|
path: [{
|
|
@@ -1433,32 +1552,32 @@ function strictObject(entries2, message2) {
|
|
|
1433
1552
|
break;
|
|
1434
1553
|
}
|
|
1435
1554
|
}
|
|
1436
|
-
} else _addIssue(this, "type", dataset,
|
|
1555
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1437
1556
|
return dataset;
|
|
1438
1557
|
}
|
|
1439
1558
|
};
|
|
1440
1559
|
}
|
|
1441
1560
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1442
|
-
function string(
|
|
1561
|
+
function string(message$1) {
|
|
1443
1562
|
return {
|
|
1444
1563
|
kind: "schema",
|
|
1445
1564
|
type: "string",
|
|
1446
1565
|
reference: string,
|
|
1447
1566
|
expects: "string",
|
|
1448
1567
|
async: false,
|
|
1449
|
-
message:
|
|
1568
|
+
message: message$1,
|
|
1450
1569
|
get "~standard"() {
|
|
1451
1570
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1452
1571
|
},
|
|
1453
|
-
"~run"(dataset,
|
|
1572
|
+
"~run"(dataset, config$1) {
|
|
1454
1573
|
if (typeof dataset.value === "string") dataset.typed = true;
|
|
1455
|
-
else _addIssue(this, "type", dataset,
|
|
1574
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1456
1575
|
return dataset;
|
|
1457
1576
|
}
|
|
1458
1577
|
};
|
|
1459
1578
|
}
|
|
1460
1579
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1461
|
-
function tuple(items,
|
|
1580
|
+
function tuple(items, message$1) {
|
|
1462
1581
|
return {
|
|
1463
1582
|
kind: "schema",
|
|
1464
1583
|
type: "tuple",
|
|
@@ -1466,25 +1585,25 @@ function tuple(items, message2) {
|
|
|
1466
1585
|
expects: "Array",
|
|
1467
1586
|
async: false,
|
|
1468
1587
|
items,
|
|
1469
|
-
message:
|
|
1588
|
+
message: message$1,
|
|
1470
1589
|
get "~standard"() {
|
|
1471
1590
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1472
1591
|
},
|
|
1473
|
-
"~run"(dataset,
|
|
1592
|
+
"~run"(dataset, config$1) {
|
|
1474
1593
|
const input = dataset.value;
|
|
1475
1594
|
if (Array.isArray(input)) {
|
|
1476
1595
|
dataset.typed = true;
|
|
1477
1596
|
dataset.value = [];
|
|
1478
1597
|
for (let key = 0; key < this.items.length; key++) {
|
|
1479
|
-
const
|
|
1480
|
-
const itemDataset = this.items[key]["~run"]({ value:
|
|
1598
|
+
const value$1 = input[key];
|
|
1599
|
+
const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
|
|
1481
1600
|
if (itemDataset.issues) {
|
|
1482
1601
|
const pathItem = {
|
|
1483
1602
|
type: "array",
|
|
1484
1603
|
origin: "value",
|
|
1485
1604
|
input,
|
|
1486
1605
|
key,
|
|
1487
|
-
value:
|
|
1606
|
+
value: value$1
|
|
1488
1607
|
};
|
|
1489
1608
|
for (const issue of itemDataset.issues) {
|
|
1490
1609
|
if (issue.path) issue.path.unshift(pathItem);
|
|
@@ -1492,7 +1611,7 @@ function tuple(items, message2) {
|
|
|
1492
1611
|
dataset.issues?.push(issue);
|
|
1493
1612
|
}
|
|
1494
1613
|
if (!dataset.issues) dataset.issues = itemDataset.issues;
|
|
1495
|
-
if (
|
|
1614
|
+
if (config$1.abortEarly) {
|
|
1496
1615
|
dataset.typed = false;
|
|
1497
1616
|
break;
|
|
1498
1617
|
}
|
|
@@ -1500,30 +1619,39 @@ function tuple(items, message2) {
|
|
|
1500
1619
|
if (!itemDataset.typed) dataset.typed = false;
|
|
1501
1620
|
dataset.value.push(itemDataset.value);
|
|
1502
1621
|
}
|
|
1503
|
-
} else _addIssue(this, "type", dataset,
|
|
1622
|
+
} else _addIssue(this, "type", dataset, config$1);
|
|
1504
1623
|
return dataset;
|
|
1505
1624
|
}
|
|
1506
1625
|
};
|
|
1507
1626
|
}
|
|
1508
1627
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1509
|
-
function undefined_(
|
|
1628
|
+
function undefined_(message$1) {
|
|
1510
1629
|
return {
|
|
1511
1630
|
kind: "schema",
|
|
1512
1631
|
type: "undefined",
|
|
1513
1632
|
reference: undefined_,
|
|
1514
1633
|
expects: "undefined",
|
|
1515
1634
|
async: false,
|
|
1516
|
-
message:
|
|
1635
|
+
message: message$1,
|
|
1517
1636
|
get "~standard"() {
|
|
1518
1637
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1519
1638
|
},
|
|
1520
|
-
"~run"(dataset,
|
|
1639
|
+
"~run"(dataset, config$1) {
|
|
1521
1640
|
if (dataset.value === void 0) dataset.typed = true;
|
|
1522
|
-
else _addIssue(this, "type", dataset,
|
|
1641
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1523
1642
|
return dataset;
|
|
1524
1643
|
}
|
|
1525
1644
|
};
|
|
1526
1645
|
}
|
|
1646
|
+
/**
|
|
1647
|
+
* Returns the sub issues of the provided datasets for the union issue.
|
|
1648
|
+
*
|
|
1649
|
+
* @param datasets The datasets.
|
|
1650
|
+
*
|
|
1651
|
+
* @returns The sub issues.
|
|
1652
|
+
*
|
|
1653
|
+
* @internal
|
|
1654
|
+
*/
|
|
1527
1655
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1528
1656
|
function _subIssues(datasets) {
|
|
1529
1657
|
let issues;
|
|
@@ -1532,7 +1660,7 @@ function _subIssues(datasets) {
|
|
|
1532
1660
|
return issues;
|
|
1533
1661
|
}
|
|
1534
1662
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1535
|
-
function union(options,
|
|
1663
|
+
function union(options, message$1) {
|
|
1536
1664
|
return {
|
|
1537
1665
|
kind: "schema",
|
|
1538
1666
|
type: "union",
|
|
@@ -1540,16 +1668,16 @@ function union(options, message2) {
|
|
|
1540
1668
|
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
1541
1669
|
async: false,
|
|
1542
1670
|
options,
|
|
1543
|
-
message:
|
|
1671
|
+
message: message$1,
|
|
1544
1672
|
get "~standard"() {
|
|
1545
1673
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1546
1674
|
},
|
|
1547
|
-
"~run"(dataset,
|
|
1675
|
+
"~run"(dataset, config$1) {
|
|
1548
1676
|
let validDataset;
|
|
1549
1677
|
let typedDatasets;
|
|
1550
1678
|
let untypedDatasets;
|
|
1551
1679
|
for (const schema of this.options) {
|
|
1552
|
-
const optionDataset = schema["~run"]({ value: dataset.value },
|
|
1680
|
+
const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
|
|
1553
1681
|
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
1554
1682
|
else typedDatasets = [optionDataset];
|
|
1555
1683
|
else {
|
|
@@ -1562,16 +1690,16 @@ function union(options, message2) {
|
|
|
1562
1690
|
if (validDataset) return validDataset;
|
|
1563
1691
|
if (typedDatasets) {
|
|
1564
1692
|
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
1565
|
-
_addIssue(this, "type", dataset,
|
|
1693
|
+
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
1566
1694
|
dataset.typed = true;
|
|
1567
1695
|
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
1568
|
-
else _addIssue(this, "type", dataset,
|
|
1696
|
+
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
1569
1697
|
return dataset;
|
|
1570
1698
|
}
|
|
1571
1699
|
};
|
|
1572
1700
|
}
|
|
1573
1701
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1574
|
-
function unionAsync(options,
|
|
1702
|
+
function unionAsync(options, message$1) {
|
|
1575
1703
|
return {
|
|
1576
1704
|
kind: "schema",
|
|
1577
1705
|
type: "union",
|
|
@@ -1579,16 +1707,16 @@ function unionAsync(options, message2) {
|
|
|
1579
1707
|
expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
|
|
1580
1708
|
async: true,
|
|
1581
1709
|
options,
|
|
1582
|
-
message:
|
|
1710
|
+
message: message$1,
|
|
1583
1711
|
get "~standard"() {
|
|
1584
1712
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1585
1713
|
},
|
|
1586
|
-
async "~run"(dataset,
|
|
1714
|
+
async "~run"(dataset, config$1) {
|
|
1587
1715
|
let validDataset;
|
|
1588
1716
|
let typedDatasets;
|
|
1589
1717
|
let untypedDatasets;
|
|
1590
1718
|
for (const schema of this.options) {
|
|
1591
|
-
const optionDataset = await schema["~run"]({ value: dataset.value },
|
|
1719
|
+
const optionDataset = await schema["~run"]({ value: dataset.value }, config$1);
|
|
1592
1720
|
if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
|
|
1593
1721
|
else typedDatasets = [optionDataset];
|
|
1594
1722
|
else {
|
|
@@ -1601,40 +1729,49 @@ function unionAsync(options, message2) {
|
|
|
1601
1729
|
if (validDataset) return validDataset;
|
|
1602
1730
|
if (typedDatasets) {
|
|
1603
1731
|
if (typedDatasets.length === 1) return typedDatasets[0];
|
|
1604
|
-
_addIssue(this, "type", dataset,
|
|
1732
|
+
_addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
|
|
1605
1733
|
dataset.typed = true;
|
|
1606
1734
|
} else if (untypedDatasets?.length === 1) return untypedDatasets[0];
|
|
1607
|
-
else _addIssue(this, "type", dataset,
|
|
1735
|
+
else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
|
|
1608
1736
|
return dataset;
|
|
1609
1737
|
}
|
|
1610
1738
|
};
|
|
1611
1739
|
}
|
|
1612
1740
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1613
|
-
function void_(
|
|
1741
|
+
function void_(message$1) {
|
|
1614
1742
|
return {
|
|
1615
1743
|
kind: "schema",
|
|
1616
1744
|
type: "void",
|
|
1617
1745
|
reference: void_,
|
|
1618
1746
|
expects: "void",
|
|
1619
1747
|
async: false,
|
|
1620
|
-
message:
|
|
1748
|
+
message: message$1,
|
|
1621
1749
|
get "~standard"() {
|
|
1622
1750
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1623
1751
|
},
|
|
1624
|
-
"~run"(dataset,
|
|
1752
|
+
"~run"(dataset, config$1) {
|
|
1625
1753
|
if (dataset.value === void 0) dataset.typed = true;
|
|
1626
|
-
else _addIssue(this, "type", dataset,
|
|
1754
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
1627
1755
|
return dataset;
|
|
1628
1756
|
}
|
|
1629
1757
|
};
|
|
1630
1758
|
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Creates a modified copy of an object schema that does not contain the
|
|
1761
|
+
* selected entries.
|
|
1762
|
+
*
|
|
1763
|
+
* @param schema The schema to omit from.
|
|
1764
|
+
* @param keys The selected entries.
|
|
1765
|
+
*
|
|
1766
|
+
* @returns An object schema.
|
|
1767
|
+
*/
|
|
1631
1768
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1632
1769
|
function omit(schema, keys) {
|
|
1633
|
-
const
|
|
1634
|
-
for (const key of keys) delete
|
|
1770
|
+
const entries$1 = { ...schema.entries };
|
|
1771
|
+
for (const key of keys) delete entries$1[key];
|
|
1635
1772
|
return {
|
|
1636
1773
|
...schema,
|
|
1637
|
-
entries:
|
|
1774
|
+
entries: entries$1,
|
|
1638
1775
|
get "~standard"() {
|
|
1639
1776
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1640
1777
|
}
|
|
@@ -1642,60 +1779,69 @@ function omit(schema, keys) {
|
|
|
1642
1779
|
}
|
|
1643
1780
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1644
1781
|
function partial(schema, keys) {
|
|
1645
|
-
const
|
|
1646
|
-
for (const key in schema.entries)
|
|
1782
|
+
const entries$1 = {};
|
|
1783
|
+
for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];
|
|
1647
1784
|
return {
|
|
1648
1785
|
...schema,
|
|
1649
|
-
entries:
|
|
1786
|
+
entries: entries$1,
|
|
1650
1787
|
get "~standard"() {
|
|
1651
1788
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1652
1789
|
}
|
|
1653
1790
|
};
|
|
1654
1791
|
}
|
|
1655
1792
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1656
|
-
function pipe(...
|
|
1793
|
+
function pipe(...pipe$1) {
|
|
1657
1794
|
return {
|
|
1658
|
-
...
|
|
1659
|
-
pipe:
|
|
1795
|
+
...pipe$1[0],
|
|
1796
|
+
pipe: pipe$1,
|
|
1660
1797
|
get "~standard"() {
|
|
1661
1798
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1662
1799
|
},
|
|
1663
|
-
"~run"(dataset,
|
|
1664
|
-
for (const item of
|
|
1800
|
+
"~run"(dataset, config$1) {
|
|
1801
|
+
for (const item of pipe$1) if (item.kind !== "metadata") {
|
|
1665
1802
|
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
1666
1803
|
dataset.typed = false;
|
|
1667
1804
|
break;
|
|
1668
1805
|
}
|
|
1669
|
-
if (!dataset.issues || !
|
|
1806
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
|
|
1670
1807
|
}
|
|
1671
1808
|
return dataset;
|
|
1672
1809
|
}
|
|
1673
1810
|
};
|
|
1674
1811
|
}
|
|
1675
1812
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1676
|
-
function pipeAsync(...
|
|
1813
|
+
function pipeAsync(...pipe$1) {
|
|
1677
1814
|
return {
|
|
1678
|
-
...
|
|
1679
|
-
pipe:
|
|
1815
|
+
...pipe$1[0],
|
|
1816
|
+
pipe: pipe$1,
|
|
1680
1817
|
async: true,
|
|
1681
1818
|
get "~standard"() {
|
|
1682
1819
|
return /* @__PURE__ */ _getStandardProps(this);
|
|
1683
1820
|
},
|
|
1684
|
-
async "~run"(dataset,
|
|
1685
|
-
for (const item of
|
|
1821
|
+
async "~run"(dataset, config$1) {
|
|
1822
|
+
for (const item of pipe$1) if (item.kind !== "metadata") {
|
|
1686
1823
|
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
1687
1824
|
dataset.typed = false;
|
|
1688
1825
|
break;
|
|
1689
1826
|
}
|
|
1690
|
-
if (!dataset.issues || !
|
|
1827
|
+
if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1);
|
|
1691
1828
|
}
|
|
1692
1829
|
return dataset;
|
|
1693
1830
|
}
|
|
1694
1831
|
};
|
|
1695
1832
|
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Parses an unknown input based on a schema.
|
|
1835
|
+
*
|
|
1836
|
+
* @param schema The schema to be used.
|
|
1837
|
+
* @param input The input to be parsed.
|
|
1838
|
+
* @param config The parse configuration.
|
|
1839
|
+
*
|
|
1840
|
+
* @returns The parse result.
|
|
1841
|
+
*/
|
|
1696
1842
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1697
|
-
function safeParse(schema, input,
|
|
1698
|
-
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(
|
|
1843
|
+
function safeParse(schema, input, config$1) {
|
|
1844
|
+
const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
|
|
1699
1845
|
return {
|
|
1700
1846
|
typed: dataset.typed,
|
|
1701
1847
|
success: !dataset.issues,
|
|
@@ -2201,7 +2347,7 @@ var RolldownOutputImpl = class extends PlainObjectLike {
|
|
|
2201
2347
|
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
2202
2348
|
|
|
2203
2349
|
//#endregion
|
|
2204
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2350
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.101.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2205
2351
|
function wrap$1(result) {
|
|
2206
2352
|
let program, module, comments, errors;
|
|
2207
2353
|
return {
|
|
@@ -3691,9 +3837,11 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3691
3837
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3692
3838
|
const plugins = rawPlugins.map((plugin) => {
|
|
3693
3839
|
if ("_parallel" in plugin) return;
|
|
3694
|
-
if (plugin instanceof BuiltinPlugin) {
|
|
3695
|
-
|
|
3696
|
-
return
|
|
3840
|
+
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
3841
|
+
case "builtin:vite-css-post": return bindingifyCSSPostPlugin(plugin, pluginContextData);
|
|
3842
|
+
case "builtin:vite-html": return bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode, pluginContextData);
|
|
3843
|
+
case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
|
|
3844
|
+
default: return bindingifyBuiltInPlugin(plugin);
|
|
3697
3845
|
}
|
|
3698
3846
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3699
3847
|
});
|