ata-validator 1.39.2 → 1.40.1

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/README.md CHANGED
@@ -70,6 +70,8 @@ if (isValid(req.body)) {
70
70
 
71
71
  The `.compiled.mjs` modules are self-contained: zero runtime dependency on ata-validator, fully tree-shakeable, with TypeScript types emitted alongside.
72
72
 
73
+ Code already written with `new Validator(schema)` gets the same result from the bundler plugin, without changes: [`@ata-project/unplugin`](https://github.com/ata-core/unplugin-ata) replaces each call whose schema is known at build time with a compiled validator that answers the same, and the runtime leaves the bundle. For the plugin's three-schema test entry a minified Vite build goes from 122.5 KB to 16.7 KB gzipped on ata 1.39.2. Schemas that arrive at runtime keep the runtime, which is the right tool for them.
74
+
73
75
  ## Measured by others
74
76
 
75
77
  Public harnesses run ata without ata's involvement. Quote these before anything in this
@@ -260,7 +262,8 @@ for. Speed is the same either way once warm.
260
262
 
261
263
  **In a browser, on an edge runtime, or anywhere cold starts are charged, compile.** This
262
264
  is where the difference is the whole story, and it is also where `new Function` is often
263
- blocked outright, which the compiled module does not need.
265
+ blocked outright, which the compiled module does not need. With a bundler, adding `@ata-project/unplugin`
266
+ is enough: it compiles `new Validator(schema)` calls at build time, and leaves the rest alone.
264
267
 
265
268
  ## When to use the runtime API instead
266
269
 
@@ -546,10 +549,13 @@ To get the compiled module without changing code written against the runtime API
546
549
  `new Validator(schema)` whose schema is known at build time is replaced with the compiled
547
550
  module wrapped by `fromCompiled()` from `ata-validator/compiled`, which answers `validate()`,
548
551
  `isValidObject()`, `validateJSON()` and `isValidJSON()` as the runtime does, defaults and errors
549
- included. For the plugin's three-schema test entry a minified Vite build goes from 115.7 KB to
550
- 15.5 KB gzipped. In Node, loading the wrapper and a compiled module and answering the first two
552
+ included. For the plugin's three-schema test entry a minified Vite build goes from 122.5 KB to
553
+ 16.7 KB gzipped on ata 1.39.2. In Node, loading the wrapper and a compiled module and answering the first two
551
554
  checks takes 1.12 ms where the runtime takes 6.63 ms (median of 15 fresh processes). Across
552
- SchemaStore's 977 schemas, 725 can be compiled away; the rest stay on the runtime.
555
+ SchemaStore's 977 schemas, 725 can be compiled away; the rest stay on the runtime. Where the code only calls `isValidObject()` or `isValidJSON()`, the plugin uses
556
+ `fromCompiledVerdict()` from `ata-validator/compiled-verdict` instead, which carries no error pipeline: a
557
+ small app that only asks for a boolean bundles to 2.6 KB gzipped, against 12.1 KB with the full wrapper, on
558
+ ata 1.40.0 with `@ata-project/unplugin` 0.5.0.
553
559
 
554
560
  Programmatic API if you prefer to script it:
555
561
 
@@ -0,0 +1,11 @@
1
+ // ata-validator/compiled-verdict: the wrapper a bundler plugin puts in place of
2
+ // `new Validator(schema)` for a schema known at build time, when the code only
3
+ // asks for a boolean. No error pipeline is included.
4
+ import type { CompiledModule, CompiledOptions } from './compiled.js';
5
+
6
+ export interface CompiledVerdictValidator<T = unknown> {
7
+ isValidObject(data: unknown): data is T;
8
+ isValidJSON(json: string): boolean;
9
+ }
10
+
11
+ export function fromCompiledVerdict<T = unknown>(mod: Pick<CompiledModule, 'isValid'>, schema: object, options?: CompiledOptions): CompiledVerdictValidator<T>;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ // ata-validator/compiled-verdict: the wrapper a bundler plugin puts in place of
4
+ // `new Validator(schema)` when the schema is known at build time and the code
5
+ // only calls isValidObject() or isValidJSON(). It carries no error pipeline;
6
+ // code that reads errors gets ata-validator/compiled instead.
7
+ module.exports = require('./lib/compiled-verdict.js');
@@ -0,0 +1,3 @@
1
+ import mod from './compiled-verdict.js';
2
+ export const { fromCompiledVerdict } = mod;
3
+ export default mod;
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ // What the two compiled wrappers share: which Validator options they accept,
4
+ // the defaults pass, and JSON parsing. lib/compiled.js answers all four entry
5
+ // points; lib/compiled-verdict.js answers only the two that return a boolean,
6
+ // so a bundle that never reads errors does not carry the error pipeline.
7
+
8
+ const { buildDefaultsApplier } = require('./defaults');
9
+
10
+ // The Validator options the wrapper answers the same way as the runtime.
11
+ // Anything else changes what the runtime does in a way the wrapper does not
12
+ // reproduce, so it is refused rather than ignored.
13
+ const COMPILED_OPTIONS = Object.freeze(['useDefaults']);
14
+
15
+ // With defaults, the document is filled in before it is checked, on every
16
+ // entry point, as the runtime does.
17
+ function prepare(mod, schema, options, name) {
18
+ if (options !== undefined && (options === null || typeof options !== 'object')) {
19
+ throw new TypeError(`${name} options must be an object`);
20
+ }
21
+ for (const key of Object.keys(options || {})) {
22
+ if (!COMPILED_OPTIONS.includes(key)) {
23
+ throw new TypeError(`${name} does not support the ${key} option; a Validator with it has to stay on the runtime`);
24
+ }
25
+ }
26
+ const fill = options && options.useDefaults === false ? null : buildDefaultsApplier(schema);
27
+ const isValid = fill ? (d) => { fill(d); return mod.isValid(d); } : mod.isValid;
28
+ return { fill, isValid };
29
+ }
30
+
31
+ function parse(text) {
32
+ try { return { value: JSON.parse(text) }; } catch (e) {
33
+ if (!(e instanceof SyntaxError)) throw e;
34
+ return { error: e };
35
+ }
36
+ }
37
+
38
+ // A frozen stand-in, as the runtime reports, when a document fails and neither
39
+ // the schema nor the extension says why (the data changed in between).
40
+ const EXT_FALLBACK = Object.freeze({ keyword: 'validation', instancePath: '', schemaPath: '#', params: {}, message: 'schema validation failed' });
41
+
42
+ // A check the schema does not carry, registered the way @ata-project/keywords
43
+ // registers `instanceof` and `typeof` on a Validator: `_extendChecks(resolve)`
44
+ // before the first call, where resolve() returns { check, errors } or null.
45
+ // The wrapper answers as the runtime does under such a check
46
+ // (validator-core.js, _extendValidate and _jsonEntryWrappers): the verdict is
47
+ // the schema's and the check's; validate() lists the schema's errors, then
48
+ // the check's; the JSON entry points run the check only on text the schema
49
+ // accepts. `extend(ext)` returns the wrapper's methods under the check, and is
50
+ // called once, on the first call after registering, with the resolved check.
51
+ function installExtension(api, schema, extend) {
52
+ let resolvers = null;
53
+ const define = (name, value) => Object.defineProperty(api, name, { value, configurable: true, writable: true, enumerable: false });
54
+ define('_schemaObj', schema);
55
+ define('_initialized', false);
56
+ define('_extendChecks', function (resolve) {
57
+ if (typeof resolve !== 'function') throw new TypeError('_extendChecks expects a function');
58
+ if (resolvers === null) {
59
+ resolvers = [];
60
+ const base = {};
61
+ for (const name of Object.keys(api)) base[name] = api[name];
62
+ // Resolved on the first call to any method, as the runtime resolves at
63
+ // its first compile, and the methods are bound once from then on.
64
+ let bound = null;
65
+ const bind = () => {
66
+ if (bound === null) {
67
+ let ext = null;
68
+ for (const r of resolvers) {
69
+ const x = r();
70
+ if (!x) continue;
71
+ ext = ext === null ? x : combine(ext, x);
72
+ }
73
+ bound = ext === null ? base : extend(base, ext);
74
+ for (const name of Object.keys(base)) api[name] = bound[name];
75
+ }
76
+ return bound;
77
+ };
78
+ for (const name of Object.keys(base)) api[name] = function (arg) { return bind()[name](arg); };
79
+ }
80
+ resolvers.push(resolve);
81
+ return api;
82
+ });
83
+ }
84
+
85
+ function combine(a, b) {
86
+ return {
87
+ check: (d) => a.check(d) && b.check(d),
88
+ errors: (d) => {
89
+ const x = a.errors(d), y = b.errors(d);
90
+ if (!x) return y;
91
+ if (!y) return x;
92
+ return x.concat(y);
93
+ },
94
+ };
95
+ }
96
+
97
+ // The JSON entry points under a check, as the runtime has them.
98
+ function extendJSON(base, { check, errors }) {
99
+ return {
100
+ validateJSON: base.validateJSON && ((text) => {
101
+ const res = base.validateJSON(text);
102
+ if (!res.valid) return res;
103
+ const p = parse(text);
104
+ if (p.error) return res;
105
+ if (check(p.value)) return res;
106
+ const e = errors(p.value);
107
+ return e && e.length ? { valid: false, errors: e } : { valid: false, errors: [EXT_FALLBACK] };
108
+ }),
109
+ isValidJSON: (text) => {
110
+ if (!base.isValidJSON(text)) return false;
111
+ const p = parse(text);
112
+ return p.error ? true : check(p.value);
113
+ },
114
+ };
115
+ }
116
+
117
+ module.exports = { COMPILED_OPTIONS, prepare, parse, installExtension, extendJSON, EXT_FALLBACK };
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ // The verdict half of lib/compiled.js: isValidObject() and isValidJSON(),
4
+ // answered as a Validator with default options answers them, defaults filled
5
+ // in first. A bundler plugin puts this in place of `new Validator(schema)`
6
+ // when the code only ever asks for a boolean, so the error pipeline (the
7
+ // rejection classes, enrichment, suggestions, JSON positions) stays out of the
8
+ // bundle. Anything that reads errors needs ata-validator/compiled.
9
+
10
+ const { prepare, parse, installExtension, extendJSON } = require('./compiled-common');
11
+
12
+ function fromCompiledVerdict(mod, schema, options) {
13
+ const { isValid } = prepare(mod, schema, options, 'fromCompiledVerdict');
14
+ const api = {
15
+ isValidObject(data) {
16
+ return isValid(data);
17
+ },
18
+ isValidJSON(text) {
19
+ const p = parse(text);
20
+ return p.error ? false : isValid(p.value);
21
+ },
22
+ };
23
+ installExtension(api, schema, (base, ext) => ({
24
+ isValidObject: (d) => base.isValidObject(d) && ext.check(d),
25
+ isValidJSON: extendJSON(base, ext).isValidJSON,
26
+ }));
27
+ return api;
28
+ }
29
+
30
+ module.exports = { fromCompiledVerdict };
package/lib/compiled.js CHANGED
@@ -16,14 +16,10 @@
16
16
  // leaves the input as it is, as the runtime then does.
17
17
 
18
18
  const { LazyRejection, RichRejection, LazyJsonRejection, _enrichLazy } = require('./rejections');
19
- const { buildDefaultsApplier } = require('./defaults');
19
+ const { COMPILED_OPTIONS, prepare, parse, installExtension, extendJSON, EXT_FALLBACK } = require('./compiled-common');
20
20
 
21
21
  const VALID_RESULT = Object.freeze({ valid: true, errors: Object.freeze([]) });
22
22
 
23
- // The Validator options the wrapper answers the same way as the runtime.
24
- // Anything else changes what the runtime does in a way the wrapper does not
25
- // reproduce, so it is refused rather than ignored.
26
- const COMPILED_OPTIONS = Object.freeze(['useDefaults']);
27
23
  const EMPTY_ERRORS = Object.freeze([]);
28
24
  const VERDICT_DISAGREES = Object.freeze({
29
25
  valid: false,
@@ -50,23 +46,12 @@ class CompiledState {
50
46
  }
51
47
 
52
48
  function fromCompiled(mod, schema, options) {
53
- if (options !== undefined && (options === null || typeof options !== 'object')) {
54
- throw new TypeError('fromCompiled options must be an object');
55
- }
56
- for (const key of Object.keys(options || {})) {
57
- if (!COMPILED_OPTIONS.includes(key)) {
58
- throw new TypeError(`fromCompiled does not support the ${key} option; a Validator with it has to stay on the runtime`);
59
- }
60
- }
49
+ const { fill, isValid } = prepare(mod, schema, options, 'fromCompiled');
61
50
  const self = new CompiledState(schema);
62
- const fill = options && options.useDefaults === false ? null : buildDefaultsApplier(schema);
63
51
  if (fill) {
64
52
  self._mutatesInput = true;
65
53
  self._preprocess = fill;
66
54
  }
67
- // With defaults, the document is filled in before it is checked, on every
68
- // entry point, as the runtime does.
69
- const isValid = fill ? (d) => { fill(d); return mod.isValid(d); } : mod.isValid;
70
55
  const errFn = mod.validate;
71
56
  // The generated function's own result, rejected: if it says valid where the
72
57
  // verdict said no, the disagreement is reported rather than turned into an
@@ -78,13 +63,7 @@ function fromCompiled(mod, schema, options) {
78
63
  const rich = (data) => new RichRejection(raw(data), data, null, self, schema, _enrichLazy);
79
64
  const buildErrors = (data) => rich(data).errors;
80
65
  const buildRawErrors = (data) => rich(data)._ataRaw();
81
- const parse = (text) => {
82
- try { return { value: JSON.parse(text) }; } catch (e) {
83
- if (!(e instanceof SyntaxError)) throw e;
84
- return { error: e };
85
- }
86
- };
87
- return {
66
+ const api = {
88
67
  validate(data) {
89
68
  if (isValid(data)) return { valid: true, data, errors: EMPTY_ERRORS };
90
69
  // The runtime returns the rich rejection directly when it rewrites input.
@@ -105,6 +84,56 @@ function fromCompiled(mod, schema, options) {
105
84
  return p.error ? false : isValid(p.value);
106
85
  },
107
86
  };
87
+ installExtension(api, schema, (base, ext) => {
88
+ const json = extendJSON(base, ext);
89
+ return {
90
+ // The verdict is the schema's and the check's. A failure lists the
91
+ // schema's errors, then the check's, read when somebody asks.
92
+ validate(data) {
93
+ const r = base.validate(data);
94
+ if (r.valid && ext.check(data)) return r;
95
+ return new ExtendedRejection(r, data, ext.errors);
96
+ },
97
+ isValidObject: (d) => base.isValidObject(d) && ext.check(d),
98
+ validateJSON: json.validateJSON,
99
+ isValidJSON: json.isValidJSON,
100
+ };
101
+ });
102
+ return api;
103
+ }
104
+
105
+ // validate() under a check, as the runtime reports it (ExtendedRejection in
106
+ // validator-core.js): the inner result's errors, then the check's.
107
+ class ExtendedRejection {
108
+ constructor(inner, data, collect) {
109
+ this.valid = false;
110
+ this._inner = inner;
111
+ this._data = data;
112
+ this._collect = collect;
113
+ this._errors = null;
114
+ }
115
+ toJSON() {
116
+ return { valid: false, errors: this.errors };
117
+ }
118
+ _ataRaw() {
119
+ const inner = this._inner;
120
+ const more = this._collect(this._data) || [];
121
+ const raw = inner.valid ? more : (typeof inner._ataRaw === 'function' ? inner._ataRaw() : inner.errors).concat(more);
122
+ return raw.length ? raw : [EXT_FALLBACK];
123
+ }
108
124
  }
125
+ Object.defineProperty(ExtendedRejection.prototype, 'errors', {
126
+ enumerable: true,
127
+ configurable: true,
128
+ get() {
129
+ if (this._errors === null) {
130
+ const inner = this._inner;
131
+ const more = this._collect(this._data) || [];
132
+ const all = inner.valid ? more : inner.errors.concat(more);
133
+ this._errors = all.length ? all : [EXT_FALLBACK];
134
+ }
135
+ return this._errors;
136
+ },
137
+ });
109
138
 
110
139
  module.exports = { fromCompiled, COMPILED_OPTIONS };
@@ -3951,7 +3951,12 @@ const FORMAT_CODEGEN = {
3951
3951
  }
3952
3952
 
3953
3953
  // Safe key escaping: use JSON.stringify to handle all special chars (newlines, null bytes, etc.)
3954
- function esc(s) { return JSON.stringify(s).slice(1, -1) }
3954
+ // A schema string as the body of a JavaScript string literal, single- or
3955
+ // double-quoted. JSON.stringify escapes the double quote and the backslash;
3956
+ // the single quote needs its own escape, because the error emitters put these
3957
+ // in '...' literals. Without it a property name holding a quote closed the
3958
+ // literal, and the rest of the name ran as code in the generated validator.
3959
+ function esc(s) { return JSON.stringify(s).slice(1, -1).replace(/'/g, "\\'") }
3955
3960
  // A schema pointer segment for a pattern: JSON Pointer escaping, then made
3956
3961
  // safe for the single-quoted literal the error emitters use.
3957
3962
  function ptrSeg(s) { return s.replace(/~/g, '~0').replace(/\//g, '~1').replace(/\\/g, '\\\\').replace(/'/g, "\\'") }
@@ -36,7 +36,7 @@ function renderCompact (errors, opts) {
36
36
  let summary = `Found ${n} error${n === 1 ? '' : 's'} in ${opts.context || 'input'}`;
37
37
  if (shown !== n) summary += `, shown as ${shown} diagnostic${shown === 1 ? '' : 's'}`;
38
38
  lines.push(summary + '.');
39
- if (!(process.stdout && process.stdout.isTTY)) {
39
+ if (!(typeof process !== 'undefined' && process.stdout && process.stdout.isTTY)) {
40
40
  lines.push('(run with --pretty for source frames)');
41
41
  }
42
42
  return lines.join('\n');
@@ -9,13 +9,21 @@ const ANSI = {
9
9
  cyan: '\x1b[36m',
10
10
  };
11
11
 
12
+ // A browser, a Worker or Deno without the Node globals has no `process`, and
13
+ // the renderers ship in the browser entry: reading it bare threw a
14
+ // ReferenceError there. Without it there is no terminal, so no colour, a
15
+ // default width and no working directory to trim.
16
+ const proc = typeof process !== 'undefined' ? process : null;
17
+
12
18
  function resolveColor (opt) {
13
19
  if (opt === 'never') return false;
14
20
  if (opt === 'always') return true;
15
- if (process.env.NO_COLOR != null && process.env.NO_COLOR !== '') return false;
16
- const fc = process.env.FORCE_COLOR;
21
+ if (proc === null) return false;
22
+ const env = proc.env || {};
23
+ if (env.NO_COLOR != null && env.NO_COLOR !== '') return false;
24
+ const fc = env.FORCE_COLOR;
17
25
  if (fc === '1' || fc === '2' || fc === '3' || fc === 'true') return true;
18
- return !!(process.stdout && process.stdout.isTTY);
26
+ return !!(proc.stdout && proc.stdout.isTTY);
19
27
  }
20
28
 
21
29
  function color (enabled, code, s) {
@@ -40,7 +48,8 @@ function pathToDotted (jsonPointer) {
40
48
 
41
49
  function trimCwd (file, cwd) {
42
50
  if (!file) return file;
43
- const c = cwd || process.cwd();
51
+ const c = cwd || (proc !== null && typeof proc.cwd === 'function' ? proc.cwd() : '');
52
+ if (!c) return file;
44
53
  if (file.startsWith(c + '/')) return file.slice(c.length + 1);
45
54
  return file;
46
55
  }
@@ -51,7 +60,7 @@ function truncateLine (text, maxWidth) {
51
60
  }
52
61
 
53
62
  function terminalWidth () {
54
- const w = process.stdout && process.stdout.columns;
63
+ const w = proc !== null && proc.stdout && proc.stdout.columns;
55
64
  return (typeof w === 'number' && w > 0) ? w : 100;
56
65
  }
57
66
 
package/lib/version.js CHANGED
@@ -7,4 +7,4 @@
7
7
  //
8
8
  // Kept in lockstep with package.json by `tests/test_version_sync.js`.
9
9
 
10
- module.exports = '1.39.2';
10
+ module.exports = '1.40.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ata-validator",
3
- "version": "1.39.2",
3
+ "version": "1.40.1",
4
4
  "description": "JSON Schema validator that compiles to plain JavaScript, still runs where code generation is blocked, and can be compiled away at build time. Passes the full official test suite.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -43,6 +43,11 @@
43
43
  "import": "./compiled.mjs",
44
44
  "require": "./compiled.js"
45
45
  },
46
+ "./compiled-verdict": {
47
+ "types": "./compiled-verdict.d.ts",
48
+ "import": "./compiled-verdict.mjs",
49
+ "require": "./compiled-verdict.js"
50
+ },
46
51
  "./package.json": "./package.json"
47
52
  },
48
53
  "sideEffects": false,
@@ -59,7 +64,7 @@
59
64
  "release:check": "node tests/test_pack_purity.js && node scripts/check-doc-coverage.js && node tests/test_error_codes_lock.js && node tests/test_safe_regex_embed.js && node tests/test_version_sync.js",
60
65
  "build": "cmake-js build --target ata",
61
66
  "rebuild": "cmake-js rebuild --target ata",
62
- "test": "node test.js && node tests/test_removed_aot_methods.js && node tests/test_no_native.js && node tests/test_no_eval.js && node tests/test_property_dependencies.js && node tests/test_v1_dialect.js && node tests/test_buffer_path_parity.js && node tests/test_text_path_errors.js && node tests/test_compiled_parity.js && node tests/test_buffer_gate.js && node tests/test_scanner_differential.js && node tests/test_validate_json_scanner_cost.js && node tests/test_buffer_reject_cost.js && node tests/test_nan_verdict.js && node tests/test_remove_additional_nested.js && node tests/test_exclusive_bounds.js && node tests/test_engine_differential.js && node tests/test_error_shape_differential.js && node tests/test_error_list_differential.js && node tests/test_output_format.js && node tests/test_standard_json_schema.js && node tests/test_retry_message.js && node tests/test_describe_schema.js && node tests/test_aot_parse.js && node tests/test_draft7_semantics.js && node tests/test_metaschema_ref.js && node tests/test_pure_js_unsupported.js && node tests/test_native_load_order.js && node tests/test_pack_purity.js && node tests/test_make_native_package.js && node tests/test_browser.js && node tests/test_browser_nofs.js && node tests/test_browser_imports_guard.js && node tests/test_esm_exports.js && node tests/test_version_sync.js && node tests/test_native_loaded.js && node tests/test_native_lazy.js && node tests/test_buffer_apis_without_native.js && node tests/test_cold_start_modules.js && node tests/test_safe_regex_embed.js && node tests/test_t_builder.js && node tests/test_async_refine.js && node tests/test_safe_regex.js && node tests/test_safe_regex_integration.js && node tests/test_regex_ecma_whitespace.js && node tests/test_regex_native_linear.js && node tests/test_aot_build.js && node tests/test_aot_differential.js && node tests/test_aot_cli_build.js && node tests/test_aot_cli_smoke.js && node tests/test_bundle_standalone.js && node tests/test_standalone_anyof.js && node tests/test_standalone_formats.js && node tests/test_aot_format_mode.js && node tests/test_aot_additional_props_errors.js && node tests/test_id_anchor_refs.js && node tests/test_engine_routing.js && node tests/test_engine_option.js && node tests/test_compile_cache_order.js && node tests/test_engine_diagnostic.js && node tests/test_format_engine_parity.js && node tests/test_error_accumulator_collision.js && node tests/test_uri_helper_parity.js && node tests/test_uri_fast_path.js && node tests/test_extend_verdict.js && node tests/test_ipv4_regex.js && node tests/test_ipv6_fast_path.js && node tests/test_nested_recursion_decline.js && node tests/test_generator_error_content.js && node tests/test_inherited_key_presence.js && node tests/test_proto_accessor.js && node tests/test_hybrid_tier.js && node tests/test_first_rejection_builds_one.js && node tests/test_container_local.js && node tests/test_one_shot_validate.js && node tests/test_fixed_pattern_inline.js && node tests/test_plan_source.js && node tests/test_fused_remove_additional.js && node tests/test_runtime_parse.js && node tests/test_formats_single_pass.js && node tests/test_email_format_cost.js && node tests/test_format_single_error.js && node tests/test_defs_pointer_alias.js && node tests/test_cross_doc_root_ref.js && node tests/test_codegen_entrypoint_agreement.js && node tests/test_ref_annotation_siblings.js && node tests/test_gate_wrapped_schemas.js && node tests/test_pattern_message_escape.js && node tests/test_nested_defaults_engines.js && node tests/test_nested_coercion_parity.js && node tests/test_preprocess_cache.js && node tests/test_large_schema_codegen.js && node tests/test_base_uri.js && node tests/test_hoisted_def_recursion.js && node tests/test_alias_definitions.js && node tests/test_property_names_ref.js && node tests/test_hybrid_agreement.js && node tests/test_codegen_edge_shapes.js && node tests/test_deferred_def_scope.js && node tests/test_node_scoped_ctx_flags.js && node tests/test_fast_slot_exhaustion.js && node tests/test_ajv_errors.js && node tests/test_custom_keywords.js && node tests/test_strict_schema.js && node tests/test_aot_external_checks.js && node tests/test_ajv_parity.js && node tests/test_user_format_error_path.js && node tests/test_unevaluated_error_path.js && node tests/test_unevaluated_error_shape.js && node tests/test_unevaluated_differential.js && node tests/fuzz_differential.js && node tests/test_pattern_properties_errors.js && node tests/test_additional_properties_scaling.js && node tests/test_additional_props_combined_cost.js && node tests/test_no_input_mutation.js && node tests/test_typed_validator_runner.js && node tests/test_define_schema.js && node tests/test_error_codes_lock.js && node tests/test_error_code_lookup.js && node tests/test_error_order.js && node tests/test_error_order_ordinal.js && node tests/test_ref_error_order.js && node tests/test_rejection_shape.js && node tests/test_lazy_normalization.js && node tests/test_value_equality.js && node tests/test_vocabulary.js && node tests/test_schema_scan.js && node tests/test_lazy_errors.js && node tests/test_single_pass_errors.js && node tests/test_lazy_json_errors.js && node tests/test_lazy_instance.js && node tests/test_cyclic_input.js && node tests/test_native_error_codes.js && node tests/test_verdict_preprocess.js && node tests/test_lite_parity.js && node tests/test_lite_bundle_size.js && node tests/test_defaults_own_keys.js && node tests/test_plan_compiler.js && node tests/test_nullable.js && node tests/test_validate_and_parse.js && node tests/test_validate_data.js && node tests/test_enrich_error.js && node tests/test_enrich_received.js && node tests/test_rich_errors_optout.js && node tests/test_error_messages.js && node tests/test_source_positions.js && node tests/fuzz_positions.js && node tests/test_malformed_json_termination.js && node tests/test_data_positions.js && node tests/test_targeted_positions.js && node tests/test_position_map_cost.js && node tests/test_targeted_positions_cost.js && node tests/test_aot_staleness.js && node tests/test_file_positions.js && node tests/test_aot_positions_cost.js && node tests/test_schema_hash.js && node tests/test_render_shared.js && node tests/test_renderers.js && node tests/test_additive_fields.js && node tests/test_diagnostic_source.js && node tests/test_diagnose.js && node tests/test_correlate.js && node tests/test_diagnostics_score.js && node tests/test_runtime_error_dx.js && node tests/test_aot_error_dx.js && node tests/test_aot_source_frames.js && node tests/test_abort_early.js && node tests/test_branch_collapse.js && node tests/test_suggestions.js && node tests/test_cli_validate.js && node tests/test_cli_version.js && node tests/test_collect_evaluated.js && node tests/test_differential_tiers.js && node tests/test_draft7.js && node tests/test_dual_path.js && node tests/test_keywords_codegen.js && node tests/test_ref_cross.js && node tests/test_shape_classifier.js && node tests/test_tier0.js && node benchmark/bench_aot_size.mjs",
67
+ "test": "node test.js && node tests/test_removed_aot_methods.js && node tests/test_no_native.js && node tests/test_no_eval.js && node tests/test_property_dependencies.js && node tests/test_v1_dialect.js && node tests/test_buffer_path_parity.js && node tests/test_text_path_errors.js && node tests/test_compiled_parity.js && node tests/test_compiled_extension_parity.js && node tests/test_buffer_gate.js && node tests/test_scanner_differential.js && node tests/test_validate_json_scanner_cost.js && node tests/test_buffer_reject_cost.js && node tests/test_nan_verdict.js && node tests/test_remove_additional_nested.js && node tests/test_exclusive_bounds.js && node tests/test_engine_differential.js && node tests/test_error_shape_differential.js && node tests/test_error_list_differential.js && node tests/test_output_format.js && node tests/test_standard_json_schema.js && node tests/test_retry_message.js && node tests/test_describe_schema.js && node tests/test_aot_parse.js && node tests/test_draft7_semantics.js && node tests/test_metaschema_ref.js && node tests/test_pure_js_unsupported.js && node tests/test_native_load_order.js && node tests/test_pack_purity.js && node tests/test_make_native_package.js && node tests/test_browser.js && node tests/test_browser_nofs.js && node tests/test_browser_imports_guard.js && node tests/test_esm_exports.js && node tests/test_version_sync.js && node tests/test_native_loaded.js && node tests/test_native_lazy.js && node tests/test_buffer_apis_without_native.js && node tests/test_cold_start_modules.js && node tests/test_safe_regex_embed.js && node tests/test_t_builder.js && node tests/test_async_refine.js && node tests/test_safe_regex.js && node tests/test_safe_regex_integration.js && node tests/test_regex_ecma_whitespace.js && node tests/test_regex_native_linear.js && node tests/test_aot_build.js && node tests/test_aot_differential.js && node tests/test_aot_cli_build.js && node tests/test_aot_cli_smoke.js && node tests/test_bundle_standalone.js && node tests/test_standalone_anyof.js && node tests/test_standalone_formats.js && node tests/test_aot_format_mode.js && node tests/test_aot_additional_props_errors.js && node tests/test_id_anchor_refs.js && node tests/test_engine_routing.js && node tests/test_engine_option.js && node tests/test_compile_cache_order.js && node tests/test_engine_diagnostic.js && node tests/test_format_engine_parity.js && node tests/test_error_accumulator_collision.js && node tests/test_uri_helper_parity.js && node tests/test_uri_fast_path.js && node tests/test_extend_verdict.js && node tests/test_ipv4_regex.js && node tests/test_ipv6_fast_path.js && node tests/test_nested_recursion_decline.js && node tests/test_generator_error_content.js && node tests/test_inherited_key_presence.js && node tests/test_proto_accessor.js && node tests/test_hybrid_tier.js && node tests/test_first_rejection_builds_one.js && node tests/test_container_local.js && node tests/test_one_shot_validate.js && node tests/test_fixed_pattern_inline.js && node tests/test_plan_source.js && node tests/test_fused_remove_additional.js && node tests/test_runtime_parse.js && node tests/test_formats_single_pass.js && node tests/test_email_format_cost.js && node tests/test_format_single_error.js && node tests/test_defs_pointer_alias.js && node tests/test_cross_doc_root_ref.js && node tests/test_codegen_entrypoint_agreement.js && node tests/test_schema_code_injection.js && node tests/test_ref_annotation_siblings.js && node tests/test_gate_wrapped_schemas.js && node tests/test_pattern_message_escape.js && node tests/test_nested_defaults_engines.js && node tests/test_nested_coercion_parity.js && node tests/test_preprocess_cache.js && node tests/test_large_schema_codegen.js && node tests/test_base_uri.js && node tests/test_hoisted_def_recursion.js && node tests/test_alias_definitions.js && node tests/test_property_names_ref.js && node tests/test_hybrid_agreement.js && node tests/test_codegen_edge_shapes.js && node tests/test_deferred_def_scope.js && node tests/test_node_scoped_ctx_flags.js && node tests/test_fast_slot_exhaustion.js && node tests/test_ajv_errors.js && node tests/test_custom_keywords.js && node tests/test_strict_schema.js && node tests/test_aot_external_checks.js && node tests/test_ajv_parity.js && node tests/test_user_format_error_path.js && node tests/test_unevaluated_error_path.js && node tests/test_unevaluated_error_shape.js && node tests/test_unevaluated_differential.js && node tests/fuzz_differential.js && node tests/test_pattern_properties_errors.js && node tests/test_additional_properties_scaling.js && node tests/test_additional_props_combined_cost.js && node tests/test_no_input_mutation.js && node tests/test_typed_validator_runner.js && node tests/test_define_schema.js && node tests/test_error_codes_lock.js && node tests/test_error_code_lookup.js && node tests/test_error_order.js && node tests/test_error_order_ordinal.js && node tests/test_ref_error_order.js && node tests/test_rejection_shape.js && node tests/test_lazy_normalization.js && node tests/test_value_equality.js && node tests/test_vocabulary.js && node tests/test_schema_scan.js && node tests/test_lazy_errors.js && node tests/test_single_pass_errors.js && node tests/test_lazy_json_errors.js && node tests/test_lazy_instance.js && node tests/test_cyclic_input.js && node tests/test_native_error_codes.js && node tests/test_verdict_preprocess.js && node tests/test_lite_parity.js && node tests/test_lite_bundle_size.js && node tests/test_defaults_own_keys.js && node tests/test_plan_compiler.js && node tests/test_nullable.js && node tests/test_validate_and_parse.js && node tests/test_validate_data.js && node tests/test_enrich_error.js && node tests/test_enrich_received.js && node tests/test_rich_errors_optout.js && node tests/test_error_messages.js && node tests/test_source_positions.js && node tests/fuzz_positions.js && node tests/test_malformed_json_termination.js && node tests/test_data_positions.js && node tests/test_targeted_positions.js && node tests/test_position_map_cost.js && node tests/test_targeted_positions_cost.js && node tests/test_aot_staleness.js && node tests/test_file_positions.js && node tests/test_aot_positions_cost.js && node tests/test_schema_hash.js && node tests/test_render_shared.js && node tests/test_renderers.js && node tests/test_render_without_process.js && node tests/test_additive_fields.js && node tests/test_diagnostic_source.js && node tests/test_diagnose.js && node tests/test_correlate.js && node tests/test_diagnostics_score.js && node tests/test_runtime_error_dx.js && node tests/test_aot_error_dx.js && node tests/test_aot_source_frames.js && node tests/test_abort_early.js && node tests/test_branch_collapse.js && node tests/test_suggestions.js && node tests/test_cli_validate.js && node tests/test_cli_version.js && node tests/test_collect_evaluated.js && node tests/test_differential_tiers.js && node tests/test_draft7.js && node tests/test_dual_path.js && node tests/test_keywords_codegen.js && node tests/test_ref_cross.js && node tests/test_shape_classifier.js && node tests/test_tier0.js && node benchmark/bench_aot_size.mjs",
63
68
  "bench:size": "node benchmark/bench_aot_size.mjs",
64
69
  "test:suite": "node tests/run_suite.js && node tests/run_suite.js draft7 && node tests/run_suite.js v1",
65
70
  "test:compat": "node tests/test_compat.js",
@@ -130,18 +135,21 @@
130
135
  "compiled.js",
131
136
  "compiled.mjs",
132
137
  "compiled.d.ts",
138
+ "compiled-verdict.js",
139
+ "compiled-verdict.mjs",
140
+ "compiled-verdict.d.ts",
133
141
  "bin/",
134
142
  "README.md",
135
143
  "LICENSE"
136
144
  ],
137
145
  "optionalDependencies": {
138
- "@ata-validator/native-darwin-arm64": "1.39.2",
139
- "@ata-validator/native-darwin-x64": "1.39.2",
140
- "@ata-validator/native-linux-arm64-gnu": "1.39.2",
141
- "@ata-validator/native-linux-arm64-musl": "1.39.2",
142
- "@ata-validator/native-linux-x64-gnu": "1.39.2",
143
- "@ata-validator/native-linux-x64-musl": "1.39.2",
144
- "@ata-validator/native-win32-x64": "1.39.2"
146
+ "@ata-validator/native-darwin-arm64": "1.40.1",
147
+ "@ata-validator/native-darwin-x64": "1.40.1",
148
+ "@ata-validator/native-linux-arm64-gnu": "1.40.1",
149
+ "@ata-validator/native-linux-arm64-musl": "1.40.1",
150
+ "@ata-validator/native-linux-x64-gnu": "1.40.1",
151
+ "@ata-validator/native-linux-x64-musl": "1.40.1",
152
+ "@ata-validator/native-win32-x64": "1.40.1"
145
153
  },
146
154
  "peerDependencies": {
147
155
  "yaml": "^2.0.0"