fastest-validator
fastest-validator copied to clipboard
:zap: The fastest JS validator library for NodeJS
I added a new `record` rule. I decided to use `record` instead of `map` because it can be confused with an native `Map` object. If everything is ok, I'll improve...
Hi, In the validation here, I have the validation below for, since there are random key:value, that can be put on. ``` data: { type: "object", empty: true, }, ```...
I don't see a way currently, but is it possible to halt the validation process as soon as a validator encounters an error? I'm using an async validator, and I'd...
`optional` setting allows `undefined` and `null` values. `nullable` setting allows `null` and disallows `undefined`. What can be done for the case when you want to allow `undefined` but disallow `null`?
Is it possible to write a schema that validates an object whose keys aren't known, but the schema of the values are? For example: ``` javascript const obj = {...
In the past, it was impossible to get any meaningful/helpful TypeScript IntelliSense from the `compile` function while using it. This PR narrows the types so that TS can do this...
```javascript const schema = { "technology.screen_size": { "type": "array", "items": { "type": "enum", "values": [ "", "Under 20\"", "20-29\"", "30-39\"", "40-49\"", "50-59\"", "60-69\"", "70-80\"", "Over 80\"" ] }, "optional": true...
#272 seems to have introduced a regression when using custom validations and multiple rules between 1.11.1 and 1.12.0. If there are multiple rules, and an earlier rules fails while a...
I have a typescript file that starts like ``` // fastest-validator.ts file import Validator from "fastest-validator"; const v = new Validator(); // usual usage follows export const responseSchemaValidator = v.compile(responseSchema);...
i need to check that value is exists if field exists and in another scenario wants to validate that value is exists if field exists with this custom value. {...