mastercheck
Advanced tools
Comparing version 0.2.11 to 0.2.12
@@ -87,3 +87,3 @@ /** | ||
* select: [ 'apple_a1', 'apple_b2', 'apple_c3' ], // Select match check. Default do not check. | ||
* existIn: 'Item', // exist in keyMap check. Default do not check. | ||
* existIn: [ 'Item' ], // exist in keyMap check. Default do not check. | ||
* }; | ||
@@ -116,4 +116,19 @@ */ | ||
} | ||
if (_option.hasOwnProperty('existIn') && this._keyMap.hasOwnProperty(_option.existIn) && !~this._keyMap[_option.existIn].indexOf(data)) { | ||
return data + ' should be exist in ' + _option.existIn; | ||
if (_option.hasOwnProperty('existIn')) { | ||
if (Array.isArray(_option.existIn)) { | ||
var has = false; | ||
for (var i = 0; i < _option.existIn.length; i++) { | ||
if (this._keyMap[_option.existIn[i]] && ~this._keyMap[_option.existIn[i]].indexOf(data)) { | ||
has = true; | ||
break; | ||
} | ||
} | ||
if (!has) { | ||
return data + ' should be exist in ' + _option.existIn; | ||
} | ||
} else { | ||
if (!this._keyMap[_option.existIn] || !~this._keyMap[_option.existIn].indexOf(data)) { | ||
return data + ' should be exist in ' + _option.existIn; | ||
} | ||
} | ||
} | ||
@@ -120,0 +135,0 @@ }; |
{ | ||
"name": "mastercheck", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"description": "mastercheck", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
36313
687