Arri Validate
This is a work in progress. Stuff will break!
A type builder and validation library built on top of the Json Type Definition (RFC 8927) . It uses AJV for parsing and serialization. This library is pretty similar to Typebox except that it creates Json Type Definition (JTD) objects instead of Json Schema objects.
A lot of inspiration was taken from both Typebox and Zod when designing this library
Example
import { a } from "arri-validate";
const User = a.object({
id: a.string(),
name: a.string(),
});
type User = a.infer<typeof User>;
const result = a.parse(User, `{"id": "1", "name": "john doe"}`);
const result = a.parse(User, `{"id": "1", "name": null}`);
Building
Run nx build arri-validate
to build the library.
Running unit tests
Run nx test arri-validate
to execute the unit tests via Jest.