文件名称:makesure:JavaScript 模式验证变得简单
文件大小:36KB
文件格式:ZIP
更新时间:2024-06-23 07:42:18
JavaScript
确保 var makesure = require ( 'makesure' ) var validateAddress = makesure ( function ( ) { this . attr ( 'street' ) . isNot ( 'empty' ) . orSay ( "can't be empty" ) } ) var validateUser = makesure ( function ( ) { this . attr ( 'name' ) . is ( 'length' , 3 , 200 ) . orSay ( 'minimum length is 3 and max is 200' ) this . attr ( 'address' ) . with ( validateAddress ) // nested } ) validateUs
【文件预览】:
makesure-master
----.travis.yml(90B)
----index.js(42B)
----package.json(975B)
----test()
--------sanitize.js(2KB)
--------makesure.js(6KB)
--------stringify.js(1010B)
--------validation.js(7KB)
--------manager.js(4KB)
--------registry.js(1KB)
--------asyncValidation.js(563B)
----LICENSE(1KB)
----dist()
--------makesure.js(85KB)
----examples()
--------express-request-validation()
----.gitignore(26B)
----CHANGELOG.md(334B)
----lib()
--------makesure.js(3KB)
--------stringify.js(226B)
--------validation.js(5KB)
--------manager.js(3KB)
--------registry.js(602B)
----Makefile(94B)
----README.md(4KB)
----bower.json(657B)