v0.14.0
v0.14.0 makes ata a first-class citizen for TypeScript users. Validator is now generic with type-narrowing predicates that compose naturally with TypeBox, Zod-from-JSON-Schema, Valibot, or hand-written types over JSON Schema literals. Pure .d.ts change, zero runtime impact.
Added
- Generic
Validator<T>with type predicateisValidObject(data): data is T. Pairs naturally with TypeBox, Zod-from-JSON-Schema, Valibot, or hand-written types over JSON Schema literals. ValidationResult<T>andValidateAndParseResult<T>are discriminated unions. On thevalid: truebranch the parsed data is typed; onvalid: falsetheerrorsarray carries the diagnostic information.
Changed
- Type-level only: accessing
result.data(orresult.valueonvalidateAndParse) without first checkingresult.validis now a TypeScript compile error. Runtime behavior is unchanged. The previous shape returnedundefinedin that position, so this surfaces an existing latent bug at compile time.
Notes
- Pure
.d.tschange. No JS, C++, AOT, or CLI behavior is affected. Bundle size unchanged. Runtime performance unchanged.