Socket
Book a DemoInstallSign in
Socket

syncano-validation

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncano-validation

> Client/Server side validation library based on Laravel.

0.1.2
latest
npmnpm
Version published
Maintainers
1
Created
Source

Syncano Validator

Client/Server side validation library based on Laravel.

XO code style CircleCI codecov

$ npm install syncano-validation

How to use

import {validate} from 'syncano-validator'

const data = {
  firstName: 'John',
  lastName: 'Doe',
  username: 'john.doe'
  email: 'john.doe@example.com',
  age: 43,
  gender: 'male'
}

const rules = {
  firstName: 'required|min:2',
  lastName: 'required|min:2',
  username: 'required|unique:users,username',
  email: 'required|email',
  age: 'required|numeric|min:18',
  gender: 'in:male,female'
}

validate(data, rules)
  .then(() => {
    // All params valid! Continue code...
  })
  .catch(errors => {
    // Handle errors
  })

TODO:

  • After (Date)
  • Alpha Dash
  • Before (Date)
  • Between
  • Confirmed
  • Date
  • Date Format
  • Different
  • Dimensions (Image Files)
  • E-Mail
  • File
  • Filled
  • Image (File)
  • In Array
  • IP Address
  • JSON
  • MIME Types
  • MIME Type By File Extension
  • Nullable
  • Not In
  • Present
  • Regular Expression
  • Same
  • Size
  • String
  • Timezone
  • Unique (Database)

FAQs

Package last updated on 11 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.