Packages

ata-validator

1.61.3 · 29 Oct 2026MIT21.8k / weekRepositoryHomepagenpmAtom feed

Upgrading ata-validator from 1.10.0 to 1.11.0

1 release in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 1.10.0Newest 1.x, Latest1.61.3
0
changes to make
0
advisories fixed
3
new
6
fixes

Release by release

  1. 1.11.0

    31 Aug 20263 new · 6 fixes
    • new

      ipv6 and hostname read the string once as well: 54.7 to 29.6 ns and 45.5 to 28.2 ns, interleaved medians. ipv6 no longer allocates two arrays per check; hostname keeps the answers of the expression it replaces, fuzzed over 300k strings with 0 mismatches.

    • new

      date-time reads the string once, with no regular expression, no date object and no allocation: 95.0 to 39.4 ns on a valid value with a Z, 103.8 to 45.3 ns with a numeric offset, interleaved medians. Fuzzed against a reference that spells out RFC 3339, with 0 mismatches over 300k strings; tests/test_formats_single_pass.js keeps both the predicate and the generated form on it.

    • new

      A constructed Validator is roughly three times smaller on the heap until it is used. The public methods and the Standard Schema entry moved from per-instance closures built in the constructor to memoized prototype accessors, and the JSON position cache is only allocated when the JSON text path first needs it. Measured per instance on a 10-key object schema, double-gc deltas over 2000 instances: 1.61 KB to 0.43 KB with a shared schema object, 2.33 KB to 1.12 KB when each instance owns its schema, 3.93 KB to 3.30 KB once compiled and used. Construction alone went from 1504 to 855 ns; construction plus first validate pays about 0.9 microseconds more, once, because the compile step's method assignments now go through a defining setter. The hot validate() path is unchanged, measured interleaved. Detached method references (const f = v.validate) still work; tests/test_lazy_instance.js pins the shape.

    • fixed

      The verdict methods answer the same question as validate() again. With coerceTypes, removeAdditional or a schema default in play, validate() ran the preprocess pass and isValidObject(), isValidJSON() and validateJSON() did not, so the same validator answered true from one and false from another for the same document: validate({ age: '26' }) accepted where isValidObject({ age: '26' }) rejected. Every path now runs the same pass. Verdict methods on a validator configured this way rewrite the input in place, as validate() already did, and the cost of the correction is 0.5 ns on isValidObject and 2.7 ns on isValidJSON, measured interleaved; validators without those options are unchanged. tests/test_verdict_preprocess.js holds all four methods to the same answers.