lazy-assert
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "lazy-assert", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "An way of doing assertion for lazy people ...", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -209,3 +209,3 @@ var lazy = require('../index'); | ||
{ | ||
"extInfo": "null", | ||
"extInfo": 'null', | ||
"fid": "null", | ||
@@ -212,0 +212,0 @@ "fileId": "null", |
@@ -44,2 +44,3 @@ var lazy = require('../index'); | ||
'04 looping c': lazy.validators.summarizeTypeValidator(c), | ||
'05 nested function': lazy.validators.summarizeTypeValidator({a: function() {}, b: [1, function() {}]}) | ||
}; | ||
@@ -46,0 +47,0 @@ |
@@ -686,3 +686,6 @@ var utils = require('./utils'); | ||
for (var key in validator[0]) { | ||
object[key] = validatorsUtils.extractValidatorFromRaw(validator[0][key]); | ||
var defaultValidator = validatorsUtils.extractValidatorFromRaw(validator[0][key]); | ||
if (defaultValidator) { | ||
object[key] = defaultValidator; | ||
} | ||
} | ||
@@ -718,2 +721,5 @@ } | ||
} | ||
else if (!result.length) { | ||
return undefined; | ||
} | ||
return result; | ||
@@ -796,4 +802,8 @@ }, | ||
} | ||
else if (typeof target === 'function') { | ||
// do not extract function as the default validator | ||
return [null, null, []]; | ||
} | ||
else { | ||
// boolean, undefined, function, string | ||
// boolean, undefined, string | ||
return [null, null, [typeof target]]; | ||
@@ -800,0 +810,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
789331
197
7323
0