UNPKG

@stacksjs/validation

Version:
21 lines (16 loc) 776 B
import rule from 'validator'; import schema, { SimpleMessagesProvider, errors as VineError } from '@vinejs/vine'; export type { Infer } from '@vinejs/vine/types' declare type SchemaString = string type SchemaNumber = number type SchemaBoolean = boolean type SchemaEnum = string[] export type SchemaType = SchemaString | SchemaNumber | SchemaBoolean | SchemaEnum export const validate = { string: (defaultValue = ''): SchemaString => defaultValue, number: (defaultValue = 1): SchemaNumber => defaultValue, boolean: (defaultValue = true): SchemaBoolean => defaultValue, enum: (values: string[]): SchemaEnum => values, } export { rule, schema, SimpleMessagesProvider, VineError } export { VineBoolean, VineDate, VineEnum, VineNumber, VineString } from '@vinejs/vine'