1.0.3 • Published 4 years ago

tspace-validator v1.0.3

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

tspace-validator

NPM version NPM downloads

Validate REST API

Install

Install with npm:

npm install tspace-validator --save

Usage

// const { Validate , Validator } = require('tspace-validator')
import { Validate , Validator } from 'tspace-validator'

const data = {
    email : 'test',
    mobile : 'test',
    username : 'username_test',
    password : ''
}

try {
    new Validator().check(data ,{ 
        email : new Validate().required('validate message').email(),
        mobile : new Validate().required().number()
        username : new Validate().required().min(3).max(5)
        password : new Validate().required().regex('\\S+@\\S+\\.\\S+')
    })
} catch (err) {
    console.log(err)
}
1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago