simpl-schema
Advanced tools
Comparing version 1.4.3 to 1.5.0
@@ -27,5 +27,6 @@ 'use strict'; | ||
// a very permissive expression. Some apps may wish to be more strict and can write their own RegExp. | ||
Email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, | ||
Email: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, | ||
// Like Email but requires the TLD (.com, etc) | ||
EmailWithTLD: /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[A-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[A-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?$/, | ||
EmailWithTLD: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, | ||
@@ -32,0 +33,0 @@ Domain: new RegExp('^' + rxDomain + '$'), |
@@ -80,2 +80,4 @@ 'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -676,3 +678,3 @@ | ||
return this.get(key, 'allowedValues'); | ||
return [].concat(_toConsumableArray(this.get(key, 'allowedValues'))); | ||
} | ||
@@ -679,0 +681,0 @@ }, { |
@@ -22,4 +22,11 @@ 'use strict'; | ||
var isAllowed = (0, _lodash2.default)(allowedValues, this.value); | ||
var isAllowed = void 0; | ||
// set defined in scope and allowedValues is its instance | ||
if (typeof Set === 'function' && allowedValues instanceof Set) { | ||
isAllowed = allowedValues.has(this.value); | ||
} else { | ||
isAllowed = (0, _lodash2.default)(allowedValues, this.value); | ||
} | ||
return isAllowed ? true : _SimpleSchema.SimpleSchema.ErrorTypes.VALUE_NOT_ALLOWED; | ||
} |
{ | ||
"name": "simpl-schema", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.", | ||
@@ -49,2 +49,3 @@ "author": "Eric Dobbertin <aldeed@gmail.com>", | ||
"babel-eslint": "^6.0.4", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
@@ -51,0 +52,0 @@ "babel-preset-react": "^6.5.0", |
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
120570
2678
14