parameter icon indicating copy to clipboard operation
parameter copied to clipboard

A parameter verify tools.

Results 35 parameter issues
Sort by recently updated
recently updated
newest added

Related issue: #25 (in chinese). **Use case:** ```javascript const obj = {test: null}; parameter.validate({ test: { type: "integer", required: false } }, obj); ``` The above code will give the...

例如用户预约日期字段,用户原先选择了一个日期,保存成功。 后来用户想暂时移除该日期,于是删除了选择的日期,此时前端将该字段以 NULL 形式告知后端,该字段已被删除。 但此时 parameter 做校验时,即使标识了 `required = false, allowEmpty = true`,仍然会报错。

npm install 提示栈溢出,应该是环境出错,验证环境应该修复,现在想要新增一些新功能,或者修复原有bug都无法做到 ![image](https://user-images.githubusercontent.com/26812703/91706052-6cc76600-ebb0-11ea-8f88-8c4ebbe923c7.png)

I would be great to have the ability to remove not permitted attributes. For example: ```js const params = { age: 25, foo: "bar" } const rules = { age:...

rule: `{ category: { type: 'array', itemType: 'int', required: false, } }` data: `{ category: [ '403', '407', '303', '307' ] }`

https://github.com/node-modules/parameter/blob/9c305ecd153af219a75046cdcf79902991251a24/index.js#L626

const Parameter = require('parameter'); var parameter = new Parameter({ translate: function() { var args = Array.prototype.slice.call(arguments); console.log(args); }, validateRoot: true, // restrict the being validate value must be a object...

https://github.com/node-modules/parameter/pull/68

添加严格校验模式,禁止接收规则之外的参数

when i check numeric types,like {price:'number'},the module convert the value of the price to number.And then,check. The problem is checking numeric enum,like {type: 'enum', values: [1, 2]}.It seems that converting...