async-validator
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -17,2 +17,6 @@ import * as util from '../util'; | ||
if (rule.pattern instanceof RegExp) { | ||
// if a RegExp instance is passed, reset `lastIndex` in case its `global` | ||
// flag is accidentally set to `true`, which in a validation scenario | ||
// is not necessary and the result might be misleading | ||
rule.pattern.lastIndex = 0; | ||
if (!rule.pattern.test(value)) { | ||
@@ -19,0 +23,0 @@ errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); |
@@ -27,2 +27,6 @@ 'use strict'; | ||
if (rule.pattern instanceof RegExp) { | ||
// if a RegExp instance is passed, reset `lastIndex` in case its `global` | ||
// flag is accidentally set to `true`, which in a validation scenario | ||
// is not necessary and the result might be misleading | ||
rule.pattern.lastIndex = 0; | ||
if (!rule.pattern.test(value)) { | ||
@@ -29,0 +33,0 @@ errors.push(util.format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); |
{ | ||
"name": "async-validator", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "validate form asynchronous", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
96538
2350