ata-validator
1.61.3 · 29 Oct 2026MIT21.8k / weekRepositoryHomepagenpmAtom feed
1.61.3 is the newest release of 1.x.
In short
1 fixed3 changed1 internal
Release note
Changed
The error and combined generators compile on the first rejection instead of at startup. Every schema compiled three functions eagerly: the verdict, the combined validate-and-collect form, and the error generator, which on a cold first call cost 8.2, 10.4 and 7.8 ms on a 120-property config schema, most of it V8 compiling each generator's own code the first time it is entered. A caller that never reads an error never needs the last two, and
validate()on a passing document does not either, so they are built on the first rejection. Compile plus first verdict on that schema: 30.7 to 10.8 ms, interleaved runs of committed builds. The warm path measured the same on all ten cases checked. The shared compile cache keepsundefinedmeaning not built yet andnullmeaning the compiler declined, in both places that seed it, andtests/test_compile_cache_order.jscaught the one seam where the two seeders disagreed during this change.The static
unevaluatedPropertiestier stopped checking membership with a first-character switch. Keys sharing a first character,ENV_0throughENV_999say, all land in one case whose body chains every name, per key of the document: theadditionalPropertiesquadratic in a different coat. Above 128 declared names the generated code reads the hoisted lookup that fixed the first one; below that the switch stays. A 1300-property config document with both of its objects closed: 87.7 to 24.5 µs, and the keyword now costs whatadditionalPropertiescosts, which is the membership test itself. Only the boolean generator has this code; the error and combined generators declineunevaluated*and the interpreted engine produces those errors.The compat shim derives each error's pointer segments and kinds once, into a key map shared by the reference-order sort and the shaping loop. The sort comparator used to re-split and re-classify both errors' pointers on every one of its comparisons, and the loop derived the same segments again per error, with the
ifwrapper's flush doing it a third time. A seven-error rejection throughata-validator/compatwithallErrors: 5.79 to 3.27 µs. The shim's own overhead overValidator.validatefell from 4.4 µs to 1.9. The compat surface is pinned bytest_compat, 106 error-format cases, 36 parity cases and the error-shape differential, all green before and after.
Fixed
The API table said
verboseattaches onlyparentSchema; it attachesparentSchema,schemaanddata, and the migration guide now lists whichparamskey each keyword carries. The performance notes recorded "length-bucketed key comparison foradditionalProperties: false" as measured and dropped on the grounds that each comparison is a pointer compare; that was right about one comparison and wrong about the total, and the note now carries the measurements that replaced it.