data-validator-joi
v1.4.0
Published
Data validation using Joi
Downloads
11
Maintainers
Readme
data-validator-joi
Data validation using Joi.
Installation
npm i data-validator-joi
Methods
- createSchema
- validArray
- validTextMinMax
- validEmptyText
- validNullText
- validNumberMinMax
- validNumberMinMaxNotReq
- validNullNumber
- validDecimalNumber
- validDecimalText
- validDate
- validUntilDate
- validEmptyDate
- validFile
Usage
import { methodName } from "data-validator-joi";
const insertSchema = createSchema({
firstName: validTextMinMax(
/^([a-zA-Z]+[\s]*)+$/,
3,
255
),
lastName: validTextMinMax(
/^([a-zA-Z]+[\s]*)+$/,
3,
255
),
});
insertSchema.validate(data);