rules:根据预定义规则验证对象 (node.js)

时间:2021-07-08 12:19:29
【文件属性】:
文件名称:rules:根据预定义规则验证对象 (node.js)
文件大小:50KB
文件格式:ZIP
更新时间:2021-07-08 12:19:29
JavaScript 规则 (node.js) 一个微小的规则框架,可用于验证任何值,通过创建规则/模式对象或将验证应用于单个值。 在这两种情况下都使用流畅的界面。 样品 架构 您创建一个对象来声明要应用的规则/不变量(类似于模式)。 流畅的界面可以轻松地为每个属性指定不变量: var nameRules = { first : mustBe ( ) . populated ( ) . string ( { minLength : 5 , maxLength : 20 } ) , [ 1 ] second : mustBe ( ) . populated ( ) . string ( { minLength : 5 , maxLength : 20 } ) , } var personRules = { name : nameRules , weight :
【文件预览】:
rules-master
----rules.njsproj(8KB)
----lib()
--------validators()
--------RulesError.js(169B)
--------namespace.js(116B)
--------rules.js(1KB)
--------mustBe.js(203B)
--------applyPropertyRule.js(1KB)
--------ensure.js(292B)
--------fluentInterface()
--------applyRules.js(791B)
--------isNumeric.js(95B)
--------hasValue.js(153B)
--------failureType.js(394B)
----spec()
--------validators()
--------testFixture.js(186B)
--------fluentInterface()
--------invoke_mocha.js(809B)
--------rules()
----examples()
--------address.js.map(1KB)
--------address.coffee(816B)
--------person.js(906B)
--------address.js(1KB)
----.travis.yml(87B)
----invoke_mocha.js(842B)
----rules.sln(957B)
----README.md(4KB)
----.gitignore(135B)
----index.js(226B)
----package.json(780B)

网友评论