Packages

@vinejs/vine

4.4.0 · 27 Apr 2026MIT595.8k / weekRepositoryHomepagenpmAtom feed

Your version

2.1.0

2 Jun 2024Where it was published

In short

5 new1 fixed3 internal

Release note

tryValidate

The tryValidate method can be used to perform validation without throwing a validation error. Instead, the errors are returned as the return value of the method, which is a tuple.

const [error, result] = validator.tryValidate({ data: {} })

The try prefix is inspired from the Java world.

in

The in validation rule has been added for the VineNumber schema type and can be used to ensure the value of field is part of the allowed values list.

toJSON

The validator.toJSON method can be used to get the validator and its refs as JSON.

Commits

  • Add tryValidate method to Vine

  • Add tryValidate method

  • Add "in" rule in default number rules

  • Add in rule for number

  • Export modifiers

  • Add validator.toJSON method to get compiled schema and refs

What's Changed

  • Export modifiers

  • Add in rule for number

  • Add "in" rule in default number rules