validup 0.5.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BaseError, interpolate, interpolate as interpolate$1 } from "@ebec/core";
2
2
  import { distinctArray } from "smob";
3
3
  import { arrayToPath, expandPath, getPathValue, pathToArray, setPathValue } from "pathtrace";
4
+ import { op, runTwinAsync, runTwinSync } from "twinop";
4
5
  //#region src/utils/has-own-property.ts
5
6
  function hasOwnProperty(obj, prop) {
6
7
  return Object.prototype.hasOwnProperty.call(obj, prop);
@@ -16,6 +17,123 @@ function isContainer(input) {
16
17
  return isObject(input) && typeof input.run === "function" && typeof input.safeRun === "function";
17
18
  }
18
19
  //#endregion
20
+ //#region src/container/paths-strict-violation.ts
21
+ /**
22
+ * Thrown by a `Container` run (all variants) when `pathsStrict` is enabled and
23
+ * one or more `pathsToInclude` / `pathsToExclude` entries matched **no mount** —
24
+ * neither an exact key match nor a prefix descent into a container mount. It
25
+ * signals a misconfigured validator graph (typically a mount key that was
26
+ * renamed out from under a caller's static path list), NOT a validation failure
27
+ * of the input.
28
+ *
29
+ * Like `RunSyncViolationError` it is structural, so the per-mount catch and
30
+ * `safeRun` / `safeRunSync` re-throw it verbatim instead of folding it into the
31
+ * issue list or a `Result.failure`. Unlike `RunSyncViolationError` it IS
32
+ * exported from the package barrel — the whole point is that consumers catch it,
33
+ * read `pathsToInclude` / `pathsToExclude`, and surface which paths went stale.
34
+ *
35
+ * The reported paths are **absolute** (prefixed with the owning container's
36
+ * `path` when the violation happens inside a nested container), so a caller sees
37
+ * `user.email` rather than the child-local `email`.
38
+ */
39
+ var PathsStrictViolationError = class extends Error {
40
+ name = "PathsStrictViolationError";
41
+ /** Absolute `pathsToInclude` entries that matched no mount. */
42
+ pathsToInclude;
43
+ /** Absolute `pathsToExclude` entries that matched no mount. */
44
+ pathsToExclude;
45
+ constructor(input) {
46
+ const pathsToInclude = input.pathsToInclude ?? [];
47
+ const pathsToExclude = input.pathsToExclude ?? [];
48
+ const parts = [];
49
+ if (pathsToInclude.length > 0) parts.push(`pathsToInclude has no mount for: ${pathsToInclude.join(", ")}`);
50
+ if (pathsToExclude.length > 0) parts.push(`pathsToExclude has no mount for: ${pathsToExclude.join(", ")}`);
51
+ super(`pathsStrict: ${parts.join("; ")}`);
52
+ this.pathsToInclude = pathsToInclude;
53
+ this.pathsToExclude = pathsToExclude;
54
+ }
55
+ };
56
+ /**
57
+ * Duck-typed check — robust against `instanceof` mismatches when a duplicate
58
+ * copy of the package exists in the dependency tree, or when the throw crosses
59
+ * a realm boundary. Mirrors the `isValidupError` / `isRunSyncViolation` pattern.
60
+ */
61
+ function isPathsStrictViolation(e) {
62
+ if (e instanceof PathsStrictViolationError) return true;
63
+ return typeof e === "object" && e !== null && e.name === "PathsStrictViolationError";
64
+ }
65
+ //#endregion
66
+ //#region src/container/run-sync-violation.ts
67
+ /**
68
+ * Thrown by `Container.runSync` when a validator returns a Promise or a
69
+ * nested container does not implement `runSync`. Marked separately from
70
+ * generic `Error` so the per-mount catch can re-throw it instead of folding
71
+ * it into the issue list (otherwise users would get "Property X is invalid"
72
+ * instead of the structural diagnostic).
73
+ *
74
+ * Internal — not exported from the package barrel.
75
+ */
76
+ var RunSyncViolationError = class extends Error {
77
+ name = "RunSyncViolationError";
78
+ };
79
+ /**
80
+ * Duck-typed check — robust against `instanceof` mismatches when a duplicate
81
+ * copy of the package exists in the dependency tree, or when the throw
82
+ * crosses a realm boundary. Mirrors the `isValidupError` pattern.
83
+ */
84
+ function isRunSyncViolation(e) {
85
+ if (e instanceof RunSyncViolationError) return true;
86
+ return typeof e === "object" && e !== null && e.name === "RunSyncViolationError";
87
+ }
88
+ //#endregion
89
+ //#region src/container/structural-throw.ts
90
+ /**
91
+ * Should this thrown value escape the issue-folding path verbatim?
92
+ *
93
+ * Three unrelated reasons say yes, and every site in `Container` that folds a
94
+ * throw into `Issue[]` has to ask all three. Collapsing them into one predicate
95
+ * keeps the list in a single place — a fourth carve-out is one edit, not three.
96
+ *
97
+ * 1. **The run was cancelled.** `signal.aborted` is a *run-state* read, not a
98
+ * property of `error`. During an aborted run the thrown value is re-raised
99
+ * **as-is** — it is NOT necessarily `signal.reason`, because a mid-flight
100
+ * validator may throw its own error before the next abort check fires. That
101
+ * contract is public (see the `@throws` block on {@link Container.run}), so
102
+ * this leg must stay a signal read and must never become an
103
+ * `isAbortError(error)` test.
104
+ * 2. **`RunSyncViolationError`.** Structural: the caller cannot use `runSync`
105
+ * against this graph. Folding it in would surface "Property X is invalid"
106
+ * instead of the diagnostic.
107
+ * 3. **`PathsStrictViolationError`.** Structural: the validator graph is
108
+ * misconfigured (a `pathsToInclude` / `pathsToExclude` entry matched no
109
+ * mount), not the input. It reaches a parent's per-mount catch because the
110
+ * child `run()` is awaited inside the `try`.
111
+ *
112
+ * Both error legs delegate to the duck-typed guards rather than `instanceof`,
113
+ * so a throw crossing a realm boundary or originating from a duplicate copy of
114
+ * the package is still recognised.
115
+ *
116
+ * **Name caveat.** "Structural" describes legs 2 and 3 exactly; leg 1 is run
117
+ * state, so an aborted run makes this return `true` for *any* value —
118
+ * including a plain validation `ValidupError` from a validator that finished
119
+ * just before the abort landed. The name is kept for continuity with the
120
+ * comments it replaces; read it as "must not be folded into issues", not as a
121
+ * statement about the error's type.
122
+ *
123
+ * Deliberately **not** a type predicate: the abort leg is true for arbitrary
124
+ * values, so `error is RunSyncViolationError | PathsStrictViolationError` would
125
+ * be an unsound narrowing. Every current caller re-throws immediately, but a
126
+ * future one might not.
127
+ *
128
+ * Internal — not exported from `container/index.ts`, and therefore not from the
129
+ * package barrel. It composes `isRunSyncViolation`, which is deliberately
130
+ * private; publishing the composite would leak that decision into the public,
131
+ * semver-protected surface.
132
+ */
133
+ function isStructuralThrow(error, signal) {
134
+ return Boolean(signal?.aborted) || isRunSyncViolation(error) || isPathsStrictViolation(error);
135
+ }
136
+ //#endregion
19
137
  //#region src/error/base.ts
20
138
  var ValidupError = class extends BaseError {
21
139
  issues;
@@ -353,7 +471,7 @@ function compose(elements, options = {}) {
353
471
  });
354
472
  if (typeof result !== "undefined") value = result;
355
473
  } catch (e) {
356
- if (bail) throw e;
474
+ if (bail || isStructuralThrow(e, ctx.signal)) throw e;
357
475
  for (const issue of errorToIssues(e)) issues.push(issue);
358
476
  }
359
477
  if (issues.length > 0) throw new ValidupError(issues);
@@ -390,7 +508,7 @@ function composeAnyOf(elements) {
390
508
  const result = await invokeComposeElement(element, { ...ctx });
391
509
  return typeof result === "undefined" ? ctx.value : result;
392
510
  } catch (e) {
393
- if (ctx.signal?.aborted) throw e;
511
+ if (isStructuralThrow(e, ctx.signal)) throw e;
394
512
  const wrapped = wrapBranchIssues(e, index);
395
513
  for (const issue of wrapped) branchIssues.push(issue);
396
514
  }
@@ -553,24 +671,35 @@ let GroupKey = /* @__PURE__ */ function(GroupKey) {
553
671
  GroupKey["WILDCARD"] = "*";
554
672
  return GroupKey;
555
673
  }({});
674
+ /**
675
+ * Atomic vocabulary for `MountOptions.optionalValue`. Each atom matches
676
+ * exactly one runtime value (the exception is `FALSY`, which stays as a
677
+ * composite shortcut). Compose multiple atoms by passing an array:
678
+ * `optionalValue: ['undefined', 'null', 'empty_string']`.
679
+ */
556
680
  let OptionalValue = /* @__PURE__ */ function(OptionalValue) {
557
681
  /**
558
- * Treats only `undefined` as optional. Default.
682
+ * `value === undefined`. **Default** when `optionalValue` is not set,
683
+ * so the core stays conservative — `0` / `''` / `false` are real
684
+ * values and reach the validator unless the caller opts in.
559
685
  */
560
686
  OptionalValue["UNDEFINED"] = "undefined";
561
- /**
562
- * Treats `null` and `undefined` as optional.
563
- */
687
+ /** `value === null` (does **not** include `undefined`). */
564
688
  OptionalValue["NULL"] = "null";
689
+ /** `value === ''`. */
690
+ OptionalValue["EMPTY_STRING"] = "empty_string";
691
+ /** `value === 0` (also matches `-0`). */
692
+ OptionalValue["ZERO"] = "zero";
693
+ /** `value === false`. */
694
+ OptionalValue["FALSE"] = "false";
695
+ /** `Number.isNaN(value)`. */
696
+ OptionalValue["NAN"] = "nan";
565
697
  /**
566
- * Treats any JS falsy value as optional — `undefined`, `null`, `false`,
567
- * `0`, `''`, `NaN`.
568
- *
569
- * **Warning**: this includes `0` and `''`. For quantity / numeric fields
570
- * where `0` is a meaningful value, prefer the predicate form
571
- * `optional: (value) => boolean` so you keep control over what counts as
572
- * missing (e.g. `optional: (v) => v === '' || v === undefined` drops the
573
- * empty string but keeps `0`).
698
+ * Composite shortcut — any JS falsy value
699
+ * (`undefined`, `null`, `''`, `0`, `false`, `NaN`). Use when you
700
+ * really mean "any of the JS falsy sentinels"; otherwise pick
701
+ * specific atoms (or compose an array) so a `0` / `false` / `''`
702
+ * with a meaningful semantic isn't silently swallowed.
574
703
  */
575
704
  OptionalValue["FALSY"] = "falsy";
576
705
  return OptionalValue;
@@ -578,16 +707,38 @@ let OptionalValue = /* @__PURE__ */ function(OptionalValue) {
578
707
  //#endregion
579
708
  //#region src/helpers/optional-value.ts
580
709
  /**
581
- * Check if input value (type of) satisfies optional value type constraint.
710
+ * Check whether `value` qualifies as "optional" under the supplied
711
+ * `optionalValue` definition.
712
+ *
713
+ * The definition can be a single atom (`'undefined'`, `'null'`, `'empty_string'`,
714
+ * `'zero'`, `'false'`, `'nan'`, `'falsy'`) or an array of atoms — in array form
715
+ * the value is optional iff **any** atom matches. Atoms match exactly one
716
+ * runtime value (the only exception is `'falsy'`, which stays as a composite
717
+ * shortcut for "any JS falsy value"). To skip on `null` *or* `undefined`,
718
+ * pass `['null', 'undefined']` explicitly.
582
719
  *
583
- * @param value
584
- * @param optionalValue
720
+ * Default is `'undefined'` so the core stays conservative — `0` / `''` /
721
+ * `false` reach the validator unless the caller explicitly opts in.
585
722
  */
586
723
  function isOptionalValue(value, optionalValue) {
587
- const optionValueNormalized = optionalValue || "undefined";
588
- if (optionValueNormalized === "null") return value === null || typeof value === "undefined";
589
- if (optionValueNormalized === "undefined") return typeof value === "undefined";
590
- return !value;
724
+ const input = optionalValue ?? "undefined";
725
+ if (Array.isArray(input)) {
726
+ for (const atom of input) if (matchAtom(value, atom)) return true;
727
+ return false;
728
+ }
729
+ return matchAtom(value, input);
730
+ }
731
+ function matchAtom(value, atom) {
732
+ switch (atom) {
733
+ case "undefined": return typeof value === "undefined";
734
+ case "null": return value === null;
735
+ case "empty_string": return value === "";
736
+ case "zero": return value === 0;
737
+ case "false": return value === false;
738
+ case "nan": return typeof value === "number" && Number.isNaN(value);
739
+ case "falsy": return !value;
740
+ default: return false;
741
+ }
591
742
  }
592
743
  //#endregion
593
744
  //#region src/helpers/path-filter.ts
@@ -692,30 +843,15 @@ function defineValidator(descriptor) {
692
843
  return descriptor;
693
844
  }
694
845
  //#endregion
695
- //#region src/container/run-sync-violation.ts
696
- /**
697
- * Thrown by `Container.runSync` when a validator returns a Promise or a
698
- * nested container does not implement `runSync`. Marked separately from
699
- * generic `Error` so the per-mount catch can re-throw it instead of folding
700
- * it into the issue list (otherwise users would get "Property X is invalid"
701
- * instead of the structural diagnostic).
702
- *
703
- * Internal — not exported from the package barrel.
704
- */
705
- var RunSyncViolationError = class extends Error {
706
- name = "RunSyncViolationError";
707
- };
846
+ //#region src/container/module.ts
708
847
  /**
709
- * Duck-typed check — robust against `instanceof` mismatches when a duplicate
710
- * copy of the package exists in the dependency tree, or when the throw
711
- * crosses a realm boundary. Mirrors the `isValidupError` pattern.
848
+ * Structural thenable probe. Used by the sync side of the validator effect to
849
+ * reject the one thing a synchronous graph cannot tolerate: a validator that
850
+ * returned a promise.
712
851
  */
713
- function isRunSyncViolation(e) {
714
- if (e instanceof RunSyncViolationError) return true;
715
- return typeof e === "object" && e !== null && e.name === "RunSyncViolationError";
852
+ function isThenable(input) {
853
+ return isObject(input) && typeof input.then === "function";
716
854
  }
717
- //#endregion
718
- //#region src/container/module.ts
719
855
  var Container = class {
720
856
  options;
721
857
  items;
@@ -827,7 +963,36 @@ var Container = class {
827
963
  */
828
964
  async run(data = {}, options = {}) {
829
965
  if (options.parallel) return this.runParallel(data, options);
966
+ return runTwinAsync(this.runBody(data, options));
967
+ }
968
+ /**
969
+ * The single mount-resolution loop behind {@link Container.run} and
970
+ * {@link Container.runSync}.
971
+ *
972
+ * Written as a **twin body** (the `twinop` package): the two impure edges,
973
+ * invoking a validator and descending into a nested container, are yielded
974
+ * as `op(asyncThunk, syncThunk)` pairs, and the driver chosen by the public
975
+ * method (`runTwinAsync` / `runTwinSync`) executes the matching side. Effect
976
+ * errors are thrown back in at the `yield` site, so the cache-write and
977
+ * issue-collection `try`/`catch` blocks below run identically in both
978
+ * variants, with no second copy of the loop to keep in lockstep.
979
+ *
980
+ * The sync thunks own the two structural probes that only `runSync` needs:
981
+ * a nested container that doesn't implement `runSync`, and a validator that
982
+ * returned a thenable. Both throw `RunSyncViolationError`, which the async
983
+ * side cannot produce.
984
+ *
985
+ * `runParallel` deliberately does NOT share this body — a generator is
986
+ * sequential by construction, and expressing "launch every mount, then
987
+ * settle" through it would mean yielding batches and giving up the
988
+ * chain-read. It shares the extracted per-key helpers instead
989
+ * (`prepareMountKey` / `resolveOptionalDirective` / `buildChildRunOptions` /
990
+ * `buildValidatorContext`).
991
+ */
992
+ *runBody(data, options) {
830
993
  const { pathsToInclude, pathsToExclude } = this.resolveContainerFilters(options);
994
+ const pathsStrict = this.resolvePathsStrict(options);
995
+ this.assertPathsStrict(pathsStrict, data, pathsToInclude, pathsToExclude, options.path);
831
996
  const output = {};
832
997
  const issues = [];
833
998
  let itemCount = 0;
@@ -839,30 +1004,42 @@ var Container = class {
839
1004
  let pathCount = 0;
840
1005
  let pathFailed = false;
841
1006
  const branchStart = issues.length;
842
- const keys = item.path ? expandPath(data, item.path) : [""];
1007
+ let keys = [];
1008
+ try {
1009
+ keys = item.path ? expandPath(data, item.path) : [""];
1010
+ } catch (e) {
1011
+ const attribution = this.describeKey(item.path || "");
1012
+ this.collectExecutionFailure({
1013
+ error: e,
1014
+ item,
1015
+ value: void 0,
1016
+ keyParts: attribution.keyParts,
1017
+ pathRelative: attribution.pathRelative,
1018
+ issues,
1019
+ signal: options.signal
1020
+ });
1021
+ pathCount = 1;
1022
+ pathFailed = true;
1023
+ }
843
1024
  for (const key of keys) {
844
- const keyParts = key ? pathToArray(key) : [];
845
- const pathRelative = keyParts.at(-1);
846
- const pathAbsolute = [...options.path ? options.path : [], ...keyParts];
1025
+ let plan;
847
1026
  let value;
848
- if (key.length > 0) value = hasOwnProperty(output, key) ? output[key] : getPathValue(data, key);
849
- else value = data;
850
- const filter = resolvePathFilter(pathsToInclude, pathsToExclude, key, item.type === "container");
851
- if (filter.skip) continue;
852
1027
  try {
853
- if (typeof item.options.optional === "function" ? item.options.optional(value) : item.options.optional && isOptionalValue(value, item.options.optionalValue)) {
854
- if (item.options.optionalInclude) output[key] = value;
1028
+ plan = this.prepareMountKey(item, key, options, pathsToInclude, pathsToExclude);
1029
+ if (key.length > 0) value = hasOwnProperty(output, key) ? output[key] : getPathValue(data, key);
1030
+ else value = data;
1031
+ if (plan.filter.skip) continue;
1032
+ const optional = this.resolveOptionalDirective(item, value, options);
1033
+ if (optional.skip) {
1034
+ if (optional.write) output[key] = optional.value;
855
1035
  } else if (item.type === "container") {
856
- const tmp = await item.data.run(isObject(value) ? value : {}, {
857
- group: options.group,
858
- flat: true,
859
- path: pathAbsolute,
860
- pathsToInclude: filter.pathsToInclude,
861
- pathsToExclude: filter.pathsToExclude,
862
- defaults: resolveDefaults(options.defaults, key),
863
- context: options.context,
864
- signal: options.signal,
865
- cache: options.cache
1036
+ const child = item.data;
1037
+ const childInput = isObject(value) ? value : {};
1038
+ const childOptions = this.buildChildRunOptions(options, key, plan, pathsStrict);
1039
+ const tmp = yield* op(() => child.run(childInput, childOptions), () => {
1040
+ const childRunSync = child.runSync;
1041
+ if (typeof childRunSync !== "function") throw new RunSyncViolationError(`runSync: nested container at "${key || "<root>"}" does not implement runSync`);
1042
+ return childRunSync.call(child, childInput, childOptions);
866
1043
  });
867
1044
  const tmpKeys = Object.keys(tmp);
868
1045
  for (const tmpKey of tmpKeys) output[this.mergePaths(key, tmpKey)] = tmp[tmpKey];
@@ -875,37 +1052,37 @@ var Container = class {
875
1052
  const cached = this.resolveCachedOutcome(item, key, snapshot, options.cache);
876
1053
  if (cached) if (cached.ok) output[key] = cached.value;
877
1054
  else throw cached.error;
878
- else try {
879
- const result = await item.data({
880
- key,
881
- path: pathAbsolute,
882
- value,
883
- data,
884
- group: options.group,
885
- context: options.context,
886
- signal: options.signal,
887
- cache: options.cache
888
- });
889
- output[key] = result;
890
- this.writeCachedOutcome(item, key, snapshot, {
891
- ok: true,
892
- value: result
893
- }, options.cache, options.signal);
894
- } catch (e) {
895
- this.writeCachedOutcome(item, key, snapshot, {
896
- ok: false,
897
- error: e
898
- }, options.cache, options.signal);
899
- throw e;
1055
+ else {
1056
+ const validator = item.data;
1057
+ const ctx = this.buildValidatorContext(key, plan, value, data, options);
1058
+ try {
1059
+ const result = yield* op(() => validator(ctx), () => {
1060
+ const outcome = validator(ctx);
1061
+ if (isThenable(outcome)) throw new RunSyncViolationError(`runSync: validator at "${key || "<root>"}" returned a Promise`);
1062
+ return outcome;
1063
+ });
1064
+ output[key] = result;
1065
+ this.writeCachedOutcome(item, key, snapshot, {
1066
+ ok: true,
1067
+ value: result
1068
+ }, options.cache, options.signal);
1069
+ } catch (e) {
1070
+ if (!isStructuralThrow(e, options.signal)) this.writeCachedOutcome(item, key, snapshot, {
1071
+ ok: false,
1072
+ error: e
1073
+ }, options.cache, options.signal);
1074
+ throw e;
1075
+ }
900
1076
  }
901
1077
  }
902
1078
  } catch (e) {
1079
+ const attribution = plan || this.describeKey(key);
903
1080
  this.collectExecutionFailure({
904
1081
  error: e,
905
1082
  item,
906
1083
  value,
907
- keyParts,
908
- pathRelative,
1084
+ keyParts: attribution.keyParts,
1085
+ pathRelative: attribution.pathRelative,
909
1086
  issues,
910
1087
  signal: options.signal
911
1088
  });
@@ -927,9 +1104,17 @@ var Container = class {
927
1104
  * Parallel-execution variant of `run()`. All mounts kick off their
928
1105
  * promises eagerly and the results are merged after `Promise.allSettled`.
929
1106
  * See `ContainerRunOptions.parallel` for the trade-off note.
1107
+ *
1108
+ * Shares every per-key helper with the sequential twin body
1109
+ * (`prepareMountKey` / `resolveOptionalDirective` / `buildChildRunOptions` /
1110
+ * `buildValidatorContext` / the cache pair) but keeps its own scheduling
1111
+ * loop — see the note on {@link Container.runBody} for why it can't be a
1112
+ * third twin driver.
930
1113
  */
931
1114
  async runParallel(data, options) {
932
1115
  const { pathsToInclude, pathsToExclude } = this.resolveContainerFilters(options);
1116
+ const pathsStrict = this.resolvePathsStrict(options);
1117
+ this.assertPathsStrict(pathsStrict, data, pathsToInclude, pathsToExclude, options.path);
933
1118
  const output = {};
934
1119
  const issues = [];
935
1120
  const itemGroups = [];
@@ -939,78 +1124,44 @@ var Container = class {
939
1124
  if (!this.isItemGroupIncluded(item, options.group)) continue;
940
1125
  const tasks = [];
941
1126
  let syncPathCount = 0;
942
- const keys = item.path ? expandPath(data, item.path) : [""];
1127
+ let keys = [];
1128
+ try {
1129
+ keys = item.path ? expandPath(data, item.path) : [""];
1130
+ } catch (e) {
1131
+ const attribution = this.describeKey(item.path || "");
1132
+ tasks.push({
1133
+ key: item.path || "",
1134
+ keyParts: attribution.keyParts,
1135
+ pathRelative: attribution.pathRelative,
1136
+ value: void 0,
1137
+ promise: this.ownRejection(Promise.reject(e)),
1138
+ kind: item.type
1139
+ });
1140
+ }
943
1141
  for (const key of keys) {
944
- const keyParts = key ? pathToArray(key) : [];
945
- const pathRelative = keyParts.at(-1);
946
- const pathAbsolute = [...options.path ? options.path : [], ...keyParts];
1142
+ let plan;
947
1143
  let value;
948
- if (key.length > 0) value = getPathValue(data, key);
949
- else value = data;
950
- const filter = resolvePathFilter(pathsToInclude, pathsToExclude, key, item.type === "container");
951
- if (filter.skip) continue;
952
- if (typeof item.options.optional === "function" ? item.options.optional(value) : item.options.optional && isOptionalValue(value, item.options.optionalValue)) {
953
- if (item.options.optionalInclude) output[key] = value;
954
- syncPathCount++;
955
- continue;
956
- }
957
1144
  let promise;
958
- if (item.type === "container") promise = item.data.run(isObject(value) ? value : {}, {
959
- group: options.group,
960
- flat: true,
961
- path: pathAbsolute,
962
- pathsToInclude: filter.pathsToInclude,
963
- pathsToExclude: filter.pathsToExclude,
964
- defaults: resolveDefaults(options.defaults, key),
965
- context: options.context,
966
- signal: options.signal,
967
- parallel: true,
968
- cache: options.cache
969
- });
970
- else {
971
- const snapshot = {
972
- value,
973
- context: options.context,
974
- group: options.group
975
- };
976
- const cached = this.resolveCachedOutcome(item, key, snapshot, options.cache);
977
- if (cached) promise = cached.ok ? Promise.resolve(cached.value) : Promise.reject(cached.error);
978
- else {
979
- const itemData = item.data;
980
- const captureItem = item;
981
- const captureKey = key;
982
- const captureSnapshot = snapshot;
983
- promise = (async () => {
984
- try {
985
- const result = await itemData({
986
- key,
987
- path: pathAbsolute,
988
- value,
989
- data,
990
- group: options.group,
991
- context: options.context,
992
- signal: options.signal,
993
- cache: options.cache
994
- });
995
- this.writeCachedOutcome(captureItem, captureKey, captureSnapshot, {
996
- ok: true,
997
- value: result
998
- }, options.cache, options.signal);
999
- return result;
1000
- } catch (e) {
1001
- this.writeCachedOutcome(captureItem, captureKey, captureSnapshot, {
1002
- ok: false,
1003
- error: e
1004
- }, options.cache, options.signal);
1005
- throw e;
1006
- }
1007
- })();
1145
+ try {
1146
+ plan = this.prepareMountKey(item, key, options, pathsToInclude, pathsToExclude);
1147
+ if (key.length > 0) value = getPathValue(data, key);
1148
+ else value = data;
1149
+ if (plan.filter.skip) continue;
1150
+ const optional = this.resolveOptionalDirective(item, value, options);
1151
+ if (optional.skip) {
1152
+ if (optional.write) output[key] = optional.value;
1153
+ syncPathCount++;
1154
+ continue;
1008
1155
  }
1156
+ promise = this.ownRejection(this.dispatchParallelMount(item, key, plan, value, data, options, pathsStrict));
1157
+ } catch (e) {
1158
+ promise = this.ownRejection(Promise.reject(e));
1009
1159
  }
1160
+ const attribution = plan || this.describeKey(key);
1010
1161
  tasks.push({
1011
1162
  key,
1012
- keyParts,
1013
- pathRelative,
1163
+ keyParts: attribution.keyParts,
1164
+ pathRelative: attribution.pathRelative,
1014
1165
  value,
1015
1166
  promise,
1016
1167
  kind: item.type
@@ -1062,6 +1213,58 @@ var Container = class {
1062
1213
  options.signal?.throwIfAborted();
1063
1214
  return this.finalizeOutput(output, options, issues, errorCount, itemCount);
1064
1215
  }
1216
+ /**
1217
+ * Claim ownership of a scheduled mount's rejection.
1218
+ *
1219
+ * `runParallel` creates every mount's promise eagerly and only attaches
1220
+ * `Promise.allSettled` after the whole scheduling loop has run. Any
1221
+ * rejection settling in that window — or, worse, any throw that escapes
1222
+ * the loop before `allSettled` is reached at all — is unowned, and Node's
1223
+ * default `--unhandled-rejections=throw` (this package requires Node >=
1224
+ * 24) terminates the process.
1225
+ *
1226
+ * The no-op subscriber below is a *second* consumer, discarded
1227
+ * immediately; the original promise is returned unchanged, so
1228
+ * `Promise.allSettled` still observes the real settlement and no outcome
1229
+ * is swallowed.
1230
+ */
1231
+ ownRejection(promise) {
1232
+ promise.catch(() => {});
1233
+ return promise;
1234
+ }
1235
+ /**
1236
+ * Create the in-flight promise for one scheduled mount. Extracted from
1237
+ * `runParallel`'s scheduling loop so the loop body reads as
1238
+ * "resolve, gate, dispatch" and the pre-dispatch `try` stays legible.
1239
+ */
1240
+ dispatchParallelMount(item, key, plan, value, data, options, pathsStrict) {
1241
+ if (item.type === "container") return item.data.run(isObject(value) ? value : {}, this.buildChildRunOptions(options, key, plan, pathsStrict, true));
1242
+ const snapshot = {
1243
+ value,
1244
+ context: options.context,
1245
+ group: options.group
1246
+ };
1247
+ const cached = this.resolveCachedOutcome(item, key, snapshot, options.cache);
1248
+ if (cached) return cached.ok ? Promise.resolve(cached.value) : Promise.reject(cached.error);
1249
+ const validator = item.data;
1250
+ const ctx = this.buildValidatorContext(key, plan, value, data, options);
1251
+ return (async () => {
1252
+ try {
1253
+ const result = await validator(ctx);
1254
+ this.writeCachedOutcome(item, key, snapshot, {
1255
+ ok: true,
1256
+ value: result
1257
+ }, options.cache, options.signal);
1258
+ return result;
1259
+ } catch (e) {
1260
+ if (!isStructuralThrow(e, options.signal)) this.writeCachedOutcome(item, key, snapshot, {
1261
+ ok: false,
1262
+ error: e
1263
+ }, options.cache, options.signal);
1264
+ throw e;
1265
+ }
1266
+ })();
1267
+ }
1065
1268
  async safeRun(input = {}, options = {}) {
1066
1269
  try {
1067
1270
  return {
@@ -1102,104 +1305,7 @@ var Container = class {
1102
1305
  * already-aborted run.
1103
1306
  */
1104
1307
  runSync(data = {}, options = {}) {
1105
- const { pathsToInclude, pathsToExclude } = this.resolveContainerFilters(options);
1106
- const output = {};
1107
- const issues = [];
1108
- let itemCount = 0;
1109
- let errorCount = 0;
1110
- for (let i = 0; i < this.items.length; i++) {
1111
- options.signal?.throwIfAborted();
1112
- const item = this.items[i];
1113
- if (!this.isItemGroupIncluded(item, options.group)) continue;
1114
- let pathCount = 0;
1115
- let pathFailed = false;
1116
- const branchStart = issues.length;
1117
- const keys = item.path ? expandPath(data, item.path) : [""];
1118
- for (const key of keys) {
1119
- const keyParts = key ? pathToArray(key) : [];
1120
- const pathRelative = keyParts.at(-1);
1121
- const pathAbsolute = [...options.path ? options.path : [], ...keyParts];
1122
- let value;
1123
- if (key.length > 0) value = hasOwnProperty(output, key) ? output[key] : getPathValue(data, key);
1124
- else value = data;
1125
- const filter = resolvePathFilter(pathsToInclude, pathsToExclude, key, item.type === "container");
1126
- if (filter.skip) continue;
1127
- try {
1128
- if (typeof item.options.optional === "function" ? item.options.optional(value) : item.options.optional && isOptionalValue(value, item.options.optionalValue)) {
1129
- if (item.options.optionalInclude) output[key] = value;
1130
- } else if (item.type === "container") {
1131
- const childRunSync = item.data.runSync;
1132
- if (typeof childRunSync !== "function") throw new RunSyncViolationError(`runSync: nested container at "${key || "<root>"}" does not implement runSync`);
1133
- const tmp = childRunSync.call(item.data, isObject(value) ? value : {}, {
1134
- group: options.group,
1135
- flat: true,
1136
- path: pathAbsolute,
1137
- pathsToInclude: filter.pathsToInclude,
1138
- pathsToExclude: filter.pathsToExclude,
1139
- defaults: resolveDefaults(options.defaults, key),
1140
- context: options.context,
1141
- signal: options.signal,
1142
- cache: options.cache
1143
- });
1144
- const tmpKeys = Object.keys(tmp);
1145
- for (const tmpKey of tmpKeys) output[this.mergePaths(key, tmpKey)] = tmp[tmpKey];
1146
- } else if (item.type === "validator") {
1147
- const snapshot = {
1148
- value,
1149
- context: options.context,
1150
- group: options.group
1151
- };
1152
- const cached = this.resolveCachedOutcome(item, key, snapshot, options.cache);
1153
- if (cached) if (cached.ok) output[key] = cached.value;
1154
- else throw cached.error;
1155
- else try {
1156
- const result = item.data({
1157
- key,
1158
- path: pathAbsolute,
1159
- value,
1160
- data,
1161
- group: options.group,
1162
- context: options.context,
1163
- signal: options.signal,
1164
- cache: options.cache
1165
- });
1166
- if (result !== null && typeof result === "object" && typeof result.then === "function") throw new RunSyncViolationError(`runSync: validator at "${key || "<root>"}" returned a Promise`);
1167
- output[key] = result;
1168
- this.writeCachedOutcome(item, key, snapshot, {
1169
- ok: true,
1170
- value: result
1171
- }, options.cache, options.signal);
1172
- } catch (e) {
1173
- if (!isRunSyncViolation(e)) this.writeCachedOutcome(item, key, snapshot, {
1174
- ok: false,
1175
- error: e
1176
- }, options.cache, options.signal);
1177
- throw e;
1178
- }
1179
- }
1180
- } catch (e) {
1181
- this.collectExecutionFailure({
1182
- error: e,
1183
- item,
1184
- value,
1185
- keyParts,
1186
- pathRelative,
1187
- issues,
1188
- signal: options.signal
1189
- });
1190
- pathFailed = true;
1191
- }
1192
- pathCount++;
1193
- }
1194
- if (pathCount > 0) {
1195
- itemCount++;
1196
- if (pathFailed) {
1197
- errorCount++;
1198
- this.wrapBranchForOneOf(issues, branchStart, item, i);
1199
- }
1200
- }
1201
- }
1202
- return this.finalizeOutput(output, options, issues, errorCount, itemCount);
1308
+ return runTwinSync(this.runBody(data, options));
1203
1309
  }
1204
1310
  safeRunSync(input = {}, options = {}) {
1205
1311
  try {
@@ -1212,6 +1318,142 @@ var Container = class {
1212
1318
  }
1213
1319
  }
1214
1320
  /**
1321
+ * Resolve everything a single `(mount, expanded key)` pair needs before
1322
+ * dispatch: the split path parts, the absolute path handed to validators
1323
+ * and child containers, and the include/exclude verdict.
1324
+ *
1325
+ * Shared verbatim by the twin body and `runParallel`. The mount's input
1326
+ * `value` is deliberately NOT read here — see {@link MountKeyPlan}.
1327
+ */
1328
+ prepareMountKey(item, key, options, pathsToInclude, pathsToExclude) {
1329
+ const keyParts = key ? pathToArray(key) : [];
1330
+ return {
1331
+ keyParts,
1332
+ pathRelative: keyParts.at(-1),
1333
+ pathAbsolute: [...options.path ? options.path : [], ...keyParts],
1334
+ filter: resolvePathFilter(pathsToInclude, pathsToExclude, key, item.type === "container")
1335
+ };
1336
+ }
1337
+ /**
1338
+ * Resolve the optional gate and — when it fires — what (if anything) the
1339
+ * skipped key contributes to the output.
1340
+ *
1341
+ * `optional` is the gate ("may this mount be skipped?"); `optionalValue` is
1342
+ * the definition of absent, resolved mount → run → container. A predicate
1343
+ * `optional` wins over the atom vocabulary entirely.
1344
+ *
1345
+ * The write directive follows the same three layers, but keys off
1346
+ * `optionalAs` **presence** rather than its value — `{ optionalAs:
1347
+ * undefined }` at any layer is a deliberate "emit `undefined`". Only when
1348
+ * no layer declares `optionalAs` does the mount-level `optionalInclude`
1349
+ * fallback (copy the input through) apply.
1350
+ */
1351
+ resolveOptionalDirective(item, value, options) {
1352
+ const resolvedOptionalValue = item.options.optionalValue ?? options.optionalValue ?? this.options.optionalValue;
1353
+ if (!(typeof item.options.optional === "function" ? item.options.optional(value) : item.options.optional && isOptionalValue(value, resolvedOptionalValue))) return {
1354
+ skip: false,
1355
+ write: false
1356
+ };
1357
+ let write = true;
1358
+ let writeValue;
1359
+ if (hasOwnProperty(item.options, "optionalAs")) writeValue = item.options.optionalAs;
1360
+ else if (hasOwnProperty(options, "optionalAs")) writeValue = options.optionalAs;
1361
+ else if (hasOwnProperty(this.options, "optionalAs")) writeValue = this.options.optionalAs;
1362
+ else if (item.options.optionalInclude) writeValue = value;
1363
+ else write = false;
1364
+ return {
1365
+ skip: true,
1366
+ write,
1367
+ value: writeValue
1368
+ };
1369
+ }
1370
+ /**
1371
+ * Re-resolve a mount's `optional` declaration for the `meta.optional`
1372
+ * stamp applied by {@link Container.collectExecutionFailure}.
1373
+ *
1374
+ * Split out from `resolveOptionalDirective` because the two calls answer
1375
+ * different questions at different times: the directive decides whether to
1376
+ * *run* the mount, this decides whether to *tag* the mount's issues. The
1377
+ * split is what lets this one contain a throw the gate cannot.
1378
+ *
1379
+ * A predicate that throws degrades to `false` (don't tag) rather than
1380
+ * propagating. This is load-bearing, not defensive: the caller is a
1381
+ * `catch` handler with no `try` above it inside the run loop, and the very
1382
+ * throw it is folding may be the predicate's own. Re-raising here escapes
1383
+ * the error path entirely, discarding **every issue collected so far** and
1384
+ * replacing them with one path-less item — so a mainstream idiom like
1385
+ * `optional: (v) => v.trim().length === 0` would, on the first absent
1386
+ * field, wipe out every other field's validation error.
1387
+ *
1388
+ * `false` is the conservative fallback: the mount's issues surface at full
1389
+ * severity instead of being downgraded to a warning by consumers such as
1390
+ * `@validup/vue`'s `getSeverity`. The predicate's failure is not swallowed
1391
+ * — it is already being folded into an issue by the caller.
1392
+ */
1393
+ resolveOptionalStamp(item, value) {
1394
+ if (typeof item.options.optional === "function") try {
1395
+ return Boolean(item.options.optional(value));
1396
+ } catch {
1397
+ return false;
1398
+ }
1399
+ return item.options.optional === true;
1400
+ }
1401
+ /**
1402
+ * Attribution fallback for a throw raised before a {@link MountKeyPlan}
1403
+ * exists — path expansion, key preparation, or the mount's value read.
1404
+ *
1405
+ * Produces the same `keyParts` / `pathRelative` pair `prepareMountKey`
1406
+ * would have, so a pre-dispatch failure is attributed to the mount that
1407
+ * caused it rather than surfacing path-less. For an item-level failure
1408
+ * (path expansion) the caller passes the *unexpanded* mount path, so a
1409
+ * glob mount is identified by its literal pattern (`items.*.name`) — the
1410
+ * keys it would have expanded to are precisely what could not be computed.
1411
+ */
1412
+ describeKey(key) {
1413
+ const keyParts = key ? pathToArray(key) : [];
1414
+ return {
1415
+ keyParts,
1416
+ pathRelative: keyParts.at(-1)
1417
+ };
1418
+ }
1419
+ /**
1420
+ * Build the option bag forwarded into a nested container's `run` /
1421
+ * `runSync`. Single source of truth for what a child inherits, so a new
1422
+ * run option is threaded downward in one place instead of three.
1423
+ */
1424
+ buildChildRunOptions(options, key, plan, pathsStrict, parallel = false) {
1425
+ return {
1426
+ group: options.group,
1427
+ flat: true,
1428
+ path: plan.pathAbsolute,
1429
+ pathsToInclude: plan.filter.pathsToInclude,
1430
+ pathsToExclude: plan.filter.pathsToExclude,
1431
+ ...pathsStrict && key.length > 0 ? { pathsStrict: true } : {},
1432
+ defaults: resolveDefaults(options.defaults, key),
1433
+ context: options.context,
1434
+ signal: options.signal,
1435
+ cache: options.cache,
1436
+ ...parallel ? { parallel: true } : {},
1437
+ optionalValue: options.optionalValue,
1438
+ ...hasOwnProperty(options, "optionalAs") ? { optionalAs: options.optionalAs } : {}
1439
+ };
1440
+ }
1441
+ /**
1442
+ * Build the context object handed to a mounted validator.
1443
+ */
1444
+ buildValidatorContext(key, plan, value, data, options) {
1445
+ return {
1446
+ key,
1447
+ path: plan.pathAbsolute,
1448
+ value,
1449
+ data,
1450
+ group: options.group,
1451
+ context: options.context,
1452
+ signal: options.signal,
1453
+ cache: options.cache
1454
+ };
1455
+ }
1456
+ /**
1215
1457
  * Lookup helper for the per-mount result cache.
1216
1458
  *
1217
1459
  * Returns `undefined` (forcing a real run) for any of:
@@ -1265,6 +1507,75 @@ var Container = class {
1265
1507
  };
1266
1508
  }
1267
1509
  /**
1510
+ * Resolve the effective `pathsStrict` flag. Run-level wins over
1511
+ * container-level; unset anywhere is `false` (the silent, back-compatible
1512
+ * default).
1513
+ */
1514
+ resolvePathsStrict(options) {
1515
+ return options.pathsStrict ?? this.options.pathsStrict ?? false;
1516
+ }
1517
+ /**
1518
+ * Structural pre-flight for `pathsStrict`. Verifies every resolved
1519
+ * `pathsToInclude` / `pathsToExclude` entry is satisfied by *this*
1520
+ * container — either an exact match against an expanded mount key, or a
1521
+ * prefix descent into a container mount (whose child re-checks the
1522
+ * forwarded remainder, since `pathsStrict` threads downward). Anything
1523
+ * unmatched throws {@link PathsStrictViolationError} with absolute paths.
1524
+ *
1525
+ * No-ops unless strict is on AND at least one filter list is present, so
1526
+ * the overhead on the common (non-strict) path is a single `??` chain.
1527
+ *
1528
+ * Notes on the match rules (kept in lockstep with `resolvePathFilter`):
1529
+ * - Keyless container mounts share the parent namespace and receive the
1530
+ * filter list verbatim, so a path could be owned by the keyless child
1531
+ * OR by a keyed sibling here — the parent can't tell without recursing.
1532
+ * To avoid false positives it treats every entry as satisfied when any
1533
+ * keyless container is present, and `pathsStrict` is NOT forwarded into
1534
+ * keyless children (that would throw for parent-sibling paths). Net:
1535
+ * keyless subtrees are a strict blind spot ("out of scope" per the issue).
1536
+ * - Group filtering is intentionally ignored: a mount excluded from the
1537
+ * active group still exists, so a path targeting it is not "stale".
1538
+ * - Expansion uses the same `expandPath(data, item.path)` the run loop
1539
+ * uses, so glob mounts are matched against the keys they actually
1540
+ * expand to for the given `data`.
1541
+ */
1542
+ assertPathsStrict(strict, data, pathsToInclude, pathsToExclude, parentPath) {
1543
+ if (!strict) return;
1544
+ const hasInclude = typeof pathsToInclude !== "undefined" && pathsToInclude.length > 0;
1545
+ const hasExclude = typeof pathsToExclude !== "undefined" && pathsToExclude.length > 0;
1546
+ if (!hasInclude && !hasExclude) return;
1547
+ const expanded = [];
1548
+ let hasKeylessContainer = false;
1549
+ for (const item of this.items) {
1550
+ const keys = item.path ? expandPath(data, item.path) : [""];
1551
+ const itemIsContainer = item.type === "container";
1552
+ if (itemIsContainer && keys.some((key) => key.length === 0)) hasKeylessContainer = true;
1553
+ expanded.push({
1554
+ keys,
1555
+ isContainer: itemIsContainer
1556
+ });
1557
+ }
1558
+ const isSatisfied = (path) => {
1559
+ if (hasKeylessContainer) return true;
1560
+ for (const entry of expanded) for (const key of entry.keys) {
1561
+ if (key.length === 0) continue;
1562
+ if (path === key) return true;
1563
+ if (entry.isContainer && path.startsWith(`${key}.`)) return true;
1564
+ }
1565
+ return false;
1566
+ };
1567
+ const toAbsolute = (path) => {
1568
+ if (!parentPath || parentPath.length === 0) return path;
1569
+ return stringifyPath([...parentPath, ...pathToArray(path)]);
1570
+ };
1571
+ const unmatchedInclude = hasInclude ? pathsToInclude.filter((path) => !isSatisfied(path)).map(toAbsolute) : [];
1572
+ const unmatchedExclude = hasExclude ? pathsToExclude.filter((path) => !isSatisfied(path)).map(toAbsolute) : [];
1573
+ if (unmatchedInclude.length > 0 || unmatchedExclude.length > 0) throw new PathsStrictViolationError({
1574
+ pathsToInclude: unmatchedInclude,
1575
+ pathsToExclude: unmatchedExclude
1576
+ });
1577
+ }
1578
+ /**
1268
1579
  * Prepend `keyParts` to a child issue's `path` and — when the child is
1269
1580
  * an `IssueGroup` — recurse into its nested issues so every leaf carries
1270
1581
  * the parent prefix. Without recursion, a child container that already
@@ -1305,9 +1616,8 @@ var Container = class {
1305
1616
  */
1306
1617
  collectExecutionFailure(context) {
1307
1618
  const { error, item, value, keyParts, pathRelative, issues, signal } = context;
1308
- if (signal?.aborted) throw error;
1309
- if (isRunSyncViolation(error)) throw error;
1310
- const isOptionalMount = typeof item.options.optional === "function" ? Boolean(item.options.optional(value)) : item.options.optional === true;
1619
+ if (isStructuralThrow(error, signal)) throw error;
1620
+ const isOptionalMount = this.resolveOptionalStamp(item, value);
1311
1621
  const markOptional = (issue) => {
1312
1622
  if (!isOptionalMount) return issue;
1313
1623
  issue.meta = {
@@ -1388,25 +1698,14 @@ var Container = class {
1388
1698
  return temp;
1389
1699
  }
1390
1700
  wrapSafeRunError(e, options) {
1391
- if (options.signal?.aborted) throw e;
1392
- if (isRunSyncViolation(e)) throw e;
1701
+ if (isStructuralThrow(e, options.signal)) throw e;
1393
1702
  if (isValidupError(e)) return {
1394
1703
  success: false,
1395
1704
  error: e
1396
1705
  };
1397
- if (isError(e)) return {
1398
- success: false,
1399
- error: new ValidupError([defineIssueItem({
1400
- path: [],
1401
- message: e.message
1402
- })])
1403
- };
1404
1706
  return {
1405
1707
  success: false,
1406
- error: new ValidupError([defineIssueItem({
1407
- path: [],
1408
- message: typeof e === "string" && e.length > 0 ? e : `Non-Error throw: ${String(e)}`
1409
- })])
1708
+ error: new ValidupError(errorToIssues(e))
1410
1709
  };
1411
1710
  }
1412
1711
  isItemGroupIncluded(item, group) {
@@ -1500,6 +1799,12 @@ var Builder = class Builder {
1500
1799
  pathsToExclude: [...this.options.pathsToExclude ?? [], ...paths]
1501
1800
  }, this.steps);
1502
1801
  }
1802
+ pathsStrict(strict = true) {
1803
+ return new Builder({
1804
+ ...this.options,
1805
+ pathsStrict: strict
1806
+ }, this.steps);
1807
+ }
1503
1808
  build() {
1504
1809
  const container = new Container(this.options);
1505
1810
  for (const step of this.steps) if (step.kind === "nest") container.mount(step.key, step.options, step.child);
@@ -1580,6 +1885,6 @@ var ResultCache = class {
1580
1885
  }
1581
1886
  };
1582
1887
  //#endregion
1583
- export { Builder, Container, GroupKey, IssueCode, OptionalValue, ResultCache, ValidupError, buildErrorMessageForAttribute, buildErrorMessageForAttributes, buildOneOfFailedGroup, compose, composeOneOf, createValidupError, defineIssueGroup, defineIssueItem, defineSchema, defineValidator, errorToIssues, flattenIssueGroups, flattenIssueItems, formatIssue, hasOwnProperty, interpolate, isContainer, isError, isIssue, isIssueGroup, isIssueItem, isObject, isOptionalValue, isResultCache, isValidatorDescriptor, isValidupError, resolveDefaults, resolvePathFilter, stringifyPath };
1888
+ export { Builder, Container, GroupKey, IssueCode, OptionalValue, PathsStrictViolationError, ResultCache, ValidupError, buildErrorMessageForAttribute, buildErrorMessageForAttributes, buildOneOfFailedGroup, compose, composeOneOf, createValidupError, defineIssueGroup, defineIssueItem, defineSchema, defineValidator, errorToIssues, flattenIssueGroups, flattenIssueItems, formatIssue, hasOwnProperty, interpolate, isContainer, isError, isIssue, isIssueGroup, isIssueItem, isObject, isOptionalValue, isPathsStrictViolation, isResultCache, isValidatorDescriptor, isValidupError, resolveDefaults, resolvePathFilter, stringifyPath };
1584
1889
 
1585
1890
  //# sourceMappingURL=index.mjs.map