Schema
Delightfully simple, feature packed and customisable tool for validation and sanitization of any kind of data. Can be used on the client side as well as on the server side.
yarn add @corets/schemanpm install --save @corets/schemaConcepts
FormQuick start
Combining schemas
Conditional validations
Custom validations
Custom sanitizers
Translations
TranslatorSchema.test()
Schema.validate()
Schema.verify()
Schema.sanitize()
Schema.sanitizeAndTest()
Schema.sanitizeAndValidate()
Schema.sanitizeAndVerify()
Schema.testAsync()
Schema.validateAsync()
Schema.verifyAsync()
Schema.sanitizeAsync()
Schema.sanitizeAndTestAsync()
Schema.sanitizeAndValidateAsync()
Schema.sanitizeAndVerifyAsync()
Schema.also()
Schema.and()
Schema.or()
Schema.map()
schema()
schema.string()
schema.number()
schema.boolean()
schema.date()
schema.array()
schema.object()
schema.mixed()
string()
string.required()
string.optional()
string.equals()
string.length()
string.min()
string.max()
string.between()
string.matches()
string.email()
string.url()
string.startsWith()
string.endsWith()
string.includes()
string.omits()
string.oneOf()
string.noneOf()
string.numeric()
string.alpha()
string.alphaNumeric()
string.alphaDashes()
string.alphaUnderscores()
string.alphaNumericDashes()
string.alphaNumericUnderscores()
string.date()
string.dateBefore()
string.dateBeforeOrEqual()
string.dateAfter()
string.dateAfterOrEqual()
string.dateBetween()
string.dateBetweenOrEqual()
string.time()
string.timeBefore()
string.timeBeforeOrEqual()
string.timeAfter()
string.timeAfterOrEqual()
string.timeBetween()
string.timeBetweenOrEqual()
string.dateTime()
string.toDefault()
string.toUpperCase()
string.toLowerCase()
string.toCapitalized()
string.toCamelCase()
string.toSnakeCase()
string.toKebabCase()
string.toConstantCase()
string.toTrimmed()
number()
number.required()
number.optional()
number.equals()
number.min()
number.max()
number.between()
number.between()
number.negative()
number.integer()
number.oneOf()
number.noneOf()
number.toDefault()
number.toRounded()
number.toFloored()
number.toCeiled()
number.toTrunced()
boolean()
boolean.required()
boolean.optional()
boolean.equals()
boolean.toDefault()
date()
date.required()
date.optional()
date.equals()
date.after()
date.before()
date.between()
date.toDefault()
array()
array.required()
array.optional()
array.equals()
array.length()
array.min()
array.max()
array.between()
array.someOf()
array.noneOf()
array.shape()
array.toDefault()
array.toFiltered()
array.toMapped()
array.toCompact()
array.toUnique()
object()
object.required()
object.optional()
object.equals()
object.shape()
object.allowUnknownKeys()
object.forbidUnknownKeys()
object.shapeUnknownKeys()
object.shapeUnknownValues()
object.toDefault()
object.toCamelCaseKeys()
object.toSnakeCaseKeys()
object.toKebabCaseKeys()
object.toConstantCaseKeys()
object.toMappedValues()
object.toMappedKeys()
mixed()
mixed.required()
mixed.optional()
mixed.equals()
mixed.oneOf()
mixed.noneOf()
mixed.toDefault()
Last updated
Was this helpful?