diegohaz / schm

Composable schemas for JavaScript and Node.js

Home Page:https://git.io/schm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement validation

diegohaz opened this issue · comments

commented
const schema = require('schm')

const userSchema = schema({
  name: {
    type: String,
    required: true,
  },
})

userSchema.validate({ name: '' }).then().catch()