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

上传者: 42134117 | 上传时间: 2021-07-09 15:03:55 | 文件大小: 50KB | 文件类型: ZIP
规则 (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 :

文件下载

资源详情

[{"title":"( 79 个子文件 50KB ) rules:根据预定义规则验证对象 (node.js)-源码","children":[{"title":"rules-master","children":[{"title":"rules.njsproj <span style='color:#111;'> 8.22KB </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"validators","children":[{"title":"date","children":[{"title":"dateRangeValidator.js <span style='color:#111;'> 1.74KB </span>","children":null,"spread":false},{"title":"dateValidator.js <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"now.js <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false}],"spread":true},{"title":"throwIfConfigHasUnexpectedKeys.js <span style='color:#111;'> 476B </span>","children":null,"spread":false},{"title":"numeric","children":[{"title":"numericValidator.js <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false},{"title":"integerValidator.js <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"numericRangeValidator.js <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false}],"spread":true},{"title":"regularExpressionValidator.js <span style='color:#111;'> 1.45KB </span>","children":null,"spread":false},{"title":"applySubValidations.js <span style='color:#111;'> 313B </span>","children":null,"spread":false},{"title":"subValidationsCreator.js <span style='color:#111;'> 571B </span>","children":null,"spread":false},{"title":"string","children":[{"title":"stringLengthValidator.js <span style='color:#111;'> 1.86KB </span>","children":null,"spread":false},{"title":"stringValidator.js <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"populatedValidator.js <span style='color:#111;'> 568B </span>","children":null,"spread":false},{"title":"arrayValidator.js <span style='color:#111;'> 441B </span>","children":null,"spread":false}],"spread":true},{"title":"RulesError.js <span style='color:#111;'> 169B </span>","children":null,"spread":false},{"title":"namespace.js <span style='color:#111;'> 116B </span>","children":null,"spread":false},{"title":"rules.js <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"mustBe.js <span style='color:#111;'> 203B </span>","children":null,"spread":false},{"title":"applyPropertyRule.js <span style='color:#111;'> 1.49KB </span>","children":null,"spread":false},{"title":"ensure.js <span style='color:#111;'> 292B </span>","children":null,"spread":false},{"title":"fluentInterface","children":[{"title":"valueFirstFluentInterface.js <span style='color:#111;'> 2.33KB </span>","children":null,"spread":false},{"title":"validationFluentInterface.js <span style='color:#111;'> 1.91KB </span>","children":null,"spread":false},{"title":"ensureFluentInterface.js <span style='color:#111;'> 1.74KB </span>","children":null,"spread":false}],"spread":true},{"title":"applyRules.js <span style='color:#111;'> 791B </span>","children":null,"spread":false},{"title":"isNumeric.js <span style='color:#111;'> 95B </span>","children":null,"spread":false},{"title":"hasValue.js <span style='color:#111;'> 153B </span>","children":null,"spread":false},{"title":"failureType.js <span style='color:#111;'> 394B </span>","children":null,"spread":false}],"spread":false},{"title":"spec","children":[{"title":"validators","children":[{"title":"date","children":[{"title":"range","children":[{"title":"handles.js <span style='color:#111;'> 651B </span>","children":null,"spread":false},{"title":"failingToCreate.js <span style='color:#111;'> 3.48KB </span>","children":null,"spread":false},{"title":"pass.js <span style='color:#111;'> 2.41KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false},{"title":"now.js <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"pass.js <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.77KB </span>","children":null,"spread":false},{"title":"faiingToCreate.js <span style='color:#111;'> 510B </span>","children":null,"spread":false}],"spread":true},{"title":"numericValidator","children":[{"title":"integer","children":[{"title":"pass.js <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false}],"spread":true},{"title":"failingToCreate.js <span style='color:#111;'> 475B </span>","children":null,"spread":false},{"title":"pass.js <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"numericRangeValidator","children":[{"title":"failingToCreate.js <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false},{"title":"pass.js <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false}],"spread":true},{"title":"fail.js <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false}],"spread":true},{"title":"array","children":[{"title":"pass.js <span style='color:#111;'> 804B </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false}],"spread":true},{"title":"regex","children":[{"title":"failingToCreate.js <span style='color:#111;'> 1.61KB </span>","children":null,"spread":false},{"title":"pass.js <span style='color:#111;'> 2.36KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.08KB </span>","children":null,"spread":false}],"spread":true},{"title":"testUtil.js <span style='color:#111;'> 1.93KB </span>","children":null,"spread":false},{"title":"populatedValidator","children":[{"title":"pass.js <span style='color:#111;'> 908B </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 984B </span>","children":null,"spread":false}],"spread":true},{"title":"string","children":[{"title":"pass.js <span style='color:#111;'> 1.24KB </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"length","children":[{"title":"failingToCreate.js <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"pass.js <span style='color:#111;'> 810B </span>","children":null,"spread":false},{"title":"fail.js <span style='color:#111;'> 1.49KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"testFixture.js <span style='color:#111;'> 186B </span>","children":null,"spread":false},{"title":"fluentInterface","children":[{"title":"applyingWithFunctions.js <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false},{"title":"ensure.js <span style='color:#111;'> 3.51KB </span>","children":null,"spread":false},{"title":"testUtil.js <span style='color:#111;'> 5.39KB </span>","children":null,"spread":false},{"title":"applyingDeclarative.js <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"invoke_mocha.js <span style='color:#111;'> 809B </span>","children":null,"spread":false},{"title":"rules","children":[{"title":"applyingNoRules.js <span style='color:#111;'> 1.09KB </span>","children":null,"spread":false},{"title":"applyToNonObject.js <span style='color:#111;'> 1.85KB </span>","children":null,"spread":false},{"title":"applyRules_hierarchy.js <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"applyRules_simple.js <span style='color:#111;'> 2.27KB </span>","children":null,"spread":false},{"title":"mustBe.js <span style='color:#111;'> 595B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"examples","children":[{"title":"address.js.map <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false},{"title":"address.coffee <span style='color:#111;'> 816B </span>","children":null,"spread":false},{"title":"person.js <span style='color:#111;'> 906B </span>","children":null,"spread":false},{"title":"address.js <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false}],"spread":true},{"title":".travis.yml <span style='color:#111;'> 87B </span>","children":null,"spread":false},{"title":"invoke_mocha.js <span style='color:#111;'> 842B </span>","children":null,"spread":false},{"title":"rules.sln <span style='color:#111;'> 957B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 4.03KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 135B </span>","children":null,"spread":false},{"title":"index.js <span style='color:#111;'> 226B </span>","children":null,"spread":false},{"title":"package.json <span style='color:#111;'> 780B </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明