【文件属性】:
文件名称:arg-schema:函数参数解析的助手
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-16 20:31:25
JavaScript
这是函数参数解析的助手。
安装
npm install arg-schema
使用示例
function foo(){
var args = new argSchema(arguments);
if (args.checkin('string a', 'number b', 'opt bool c', 'object d', 'array e', 'opt function f')) {
// Put code here
// You can use args.a, args.b, ..., but optional arguments can be undefined
}
else if (args.checkin('bool a', 'opt array b', 'opt bool c', 'opt function d')) {
//
【文件预览】:
arg-schema-master
----lib()
--------index.js(3KB)
----test.js(3KB)
----LICENSE(1KB)
----README.md(649B)
----.gitignore(13B)
----package.json(686B)