Ajv-ts reached 0.7! 馃帀

ajv/README.md at master 路 ajv-validator/ajv 路 GitHub

Note: The library is not an official ajv extension

What's up, guys! Today I will show you a massive product update for the library inspired by zod - ajv-ts. Release link - here

Why have there been no updates for a long time? Well, the previous release was on 1 Feb 2024. The release date for 0.7 is 4 July 2024. That's because I'm working on this library in my free time and out of work.

extend the error method for mapping custom messages. Originally works from ajv-errors and examples from this docs are works

examples:

const a = s.string().error({ _: "any error here", type: "not a string. Custom" });

a.parse(123); // throws "not a string. Custom"

Just see in action:

import s from "ajv-ts";
s.string().minLength(3).maxLength(1); // error. MaxLength < MinLength

s.array().minLength(4).maxLength(2); // error. MaxLength < MinLength

s.string().length(-1); // error. Length is negative

Well, mostly that's it. Again, you can see the release 0.7 here.

I already have a to-do list of new features, like three-shaking, and strict pre/post processing with TS autocomplete. Will see what lands first!

Take care!