@warlock.js/seal 5.26.0 → 5.28.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/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `@warlock.js/seal` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.28.0 - 2026-10-01
8
+
9
+ ### Fixed
10
+
11
+ - `v.object()` now emits its validated output (and reports child errors) in declared schema order instead of the order async field validators happened to finish, so output key order is deterministic; unknown keys kept by `allowUnknown()` follow the declared keys in input order.
12
+
13
+ ## 5.27.0 - 2026-10-01
14
+
15
+ ### Changed
16
+
17
+ - Dependency: @mongez/supportive-is 3.0 (type-predicate checkers).
18
+
7
19
  ## 5.26.0 - 2026-09-30
8
20
 
9
21
  ### Changed
package/cjs/index.cjs CHANGED
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
 
28
28
  //#endregion
29
29
  const require_required_methods = require('./required-methods-BOVNRtci.cjs');
30
- const require_object = require('./object-BuKApaax.cjs');
30
+ const require_object = require('./object-DubGC-xu.cjs');
31
31
  const require_string = require('./string-DpDpgefH.cjs');
32
32
  let _mongez_reinforcements = require("@mongez/reinforcements");
33
33
  let _mongez_supportive_is = require("@mongez/supportive-is");
@@ -1558,6 +1558,10 @@ var LiteralValidator = class extends require_required_methods.BaseValidator {
1558
1558
 
1559
1559
  //#endregion
1560
1560
  //#region ../seal/src/validators/discriminated-union-validator.ts
1561
+ /** Whether a value read from the payload can be a discriminator key. */
1562
+ function isDiscriminatorValue(value) {
1563
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
1564
+ }
1561
1565
  /**
1562
1566
  * Discriminated union validator — routes payloads by a shared discriminator field.
1563
1567
  *
@@ -1633,7 +1637,7 @@ var DiscriminatedUnionValidator = class DiscriminatedUnionValidator extends requ
1633
1637
  data: void 0
1634
1638
  };
1635
1639
  const discriminatorValue = data[this.discriminator];
1636
- const branch = this.branches.get(discriminatorValue);
1640
+ const branch = isDiscriminatorValue(discriminatorValue) ? this.branches.get(discriminatorValue) : void 0;
1637
1641
  if (!branch) {
1638
1642
  const allowed = [...this.branches.keys()].map((k) => String(k)).join(", ");
1639
1643
  return {