Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

poom-jov

onapis15ISC1.0.2TypeScript support: included

Module help parser request body for poom

readme

jov

Json Object Validator

Installation

npm i poom-jov -S

Examples

import { validate, Schema, jov, JOV } from './'

class MyScheme {

  @JOV()
  mytype(vl, key, mode, a) {
    console.log(vl, key, mode, a)
    if (vl === key) throw new Error('not equal key')
    return vl
  }
}

async function main() {
  validate({
    name: 123
  }, {
      name: jov().mytype('thanh', 'a')
    })
}

main()