check-data
Advanced tools
Comparing version 1.7.5 to 1.7.6
14
index.js
@@ -234,16 +234,14 @@ "use strict" | ||
// 对象空值过滤 | ||
filterNull(output.data) | ||
// 数据构函数 | ||
for (let name in handler) { | ||
let options = handler[name] | ||
let item = handler[name] | ||
// 使用自定义构造函数处理 | ||
if (typeof options === 'function') { | ||
let outData = options.call(output.data, output.data) | ||
// 对象空值过滤 | ||
output[name] = filterNull(outData) | ||
if (typeof item === 'function') { | ||
output.data[name] = item.call(output.data, output.data) | ||
} | ||
} | ||
// 对象空值过滤 | ||
filterNull(output.data) | ||
return output | ||
@@ -250,0 +248,0 @@ |
{ | ||
"name": "check-data", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"description": "JS对象验证器", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,3 +10,3 @@ "use strict" | ||
"tenderEndTime": "2017-07-07T09:53:30.000Z", | ||
// "files": ["abc.js", "334", "null", "666", "12"], | ||
"files": ["abc.js", "334", "null", "666", "12"], | ||
"user": { | ||
@@ -50,3 +50,3 @@ "username": "莉莉", | ||
let { error, data, filter } = Validator(json, | ||
let { error, data } = Validator(json, | ||
{ | ||
@@ -171,2 +171,2 @@ "tenderName": { | ||
console.log(data) | ||
console.log(filter) | ||
console.log(data.filter) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27011
657