1.0.1 • Published 2 years ago

simple-form-validation-library v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Simple Validation library

Usage

import { Schema } from "./validation"

const schema = new Schema({
    first_name: (field) => field.string().required(),
    last_name: (field) => field.string().required(),
    email: (field) => field.string().required().email(),
    password: (field) => field.string().required().password(),
})

const { valid, errors } = schema.validateForm({
    first_name: "john",
    last_name: "doe",
    email: "john@doe.com",
    password: "password"
})