文件名称:aproba:一个轻量级的函数参数验证器
文件大小:34KB
文件格式:ZIP
更新时间:2024-05-18 07:53:29
JavaScript
阿波罗巴 一个轻量级的函数参数验证器 var validate = require("aproba") function myfunc(a, b, c) { // `a` must be a string, `b` a number, `c` a function validate('SNF', arguments) // [a,b,c] is also valid } myfunc('test', 23, function () {}) // ok myfunc(123, 23, function () {}) // type error myfunc('test', 23) // missing arg error myfunc('test', 23, function () {}, true) // too many args error 有效类型为: 类型 描述 * 匹
【文件预览】:
aproba-master
----.travis.yml(156B)
----LICENSE(752B)
----test()
--------aproba-arg-validation.js(1KB)
--------index.js(2KB)
----README.md(3KB)
----.gitignore(32B)
----index.js(4KB)
----CHANGELOG.md(168B)
----package-lock.json(153KB)
----package.json(740B)