Packages

ata-validator

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

Your version

1.46.0

6 Oct 2026Where it was published

1.61.3 is the newest release of 1.x.

In short

8 changed

Release note

Reading the errors of a rejected document is what this release is about. Once a validator's errors have been read, validate() is one function that checks and collects in a single pass, and the slow parts of that pass are rewritten: run-time unevaluatedProperties and unevaluatedItems as straight-line code, oneOf and anyOf branches scored with counting copies instead of run twice, error order kept beside the list instead of sorted afterwards, $dynamicRef schemas on generated code.

Measured against 1.45.0 on an Apple M4 Pro, Node 25.2.1, pure JS. Twenty SchemaStore API schemas, each with an accepted body, a rejected body and a realistic rejected body (one wrong type deep inside); both builds in one process with the rounds alternating, medians of eleven, summed over the twenty:

  • validate() on an accepted body: 37 percent less time; the verdict alone 39 percent less

  • A rejected body with every error read: 47 percent less; the realistic one 52 percent less, its verdict 59 percent less

  • The official test suite harness, every error read: draft 2020-12 70 to 49 µs per round, draft 7 30 to 29

Costs: cold start 8.0 to 8.4 ms; the browser runtime bundle 116.4 to 125.2 KB gzipped. Modules from ata build are the same size, except for a schema with $ref: "#", whose module now carries its error function instead of a stub. A served request's cost is unchanged within three percent.

Also in this release:

  • ata migrate [dir] reports what switching a project from ajv to ata-validator/compat would change, and --write applies the mechanical part.

  • A standalone module for a schema with $ref: "#" anywhere in it reports the real errors; it reported one stub error before.

  • A pattern with a finite repeat of a group stays on the platform regex engine.

  • A rejected parse() works out its errors when they are first read.

  • The one-pass function collects from its first check and does not ask the whole-document verdict first; on three of the twenty schemas an accepted body costs 60 to 70 ns more than on 1.45.0 while their rejections cost a third to a tenth. The CHANGELOG has the details.

The full list is in CHANGELOG.md.