match constraints 检查对象匹配给定的一组约束
匹配约束检查一个JS对象是否匹配指定的约束。这是用于简单的对象匹配。如果您需要更高级的操作,其他库可能会更好,例如请参见validator.js 。安装$ npm install match-constraints用法// You may use matchConstraints to throw errors on constraints failures, ot matchConstraintsBool to return false on failures. var matchConstraints = require ( 'match-constraints' ) . matchConstraints ; /* Simple use case */ var constraints = { name : "hello" } ; matchConstrai
下载地址
用户评论