async-validator
Advanced tools
Comparing version 1.8.2 to 1.8.4
@@ -18,2 +18,4 @@ import * as util from '../util'; | ||
var max = typeof rule.max === 'number'; | ||
// 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane) | ||
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; | ||
var val = value; | ||
@@ -37,5 +39,9 @@ var key = null; | ||
} | ||
if (str || arr) { | ||
if (arr) { | ||
val = value.length; | ||
} | ||
if (str) { | ||
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3 | ||
val = value.replace(spRegexp, '_').length; | ||
} | ||
if (len) { | ||
@@ -42,0 +48,0 @@ if (val !== rule.len) { |
@@ -28,2 +28,4 @@ 'use strict'; | ||
var max = typeof rule.max === 'number'; | ||
// 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane) | ||
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; | ||
var val = value; | ||
@@ -47,5 +49,9 @@ var key = null; | ||
} | ||
if (str || arr) { | ||
if (arr) { | ||
val = value.length; | ||
} | ||
if (str) { | ||
// 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3 | ||
val = value.replace(spRegexp, '_').length; | ||
} | ||
if (len) { | ||
@@ -52,0 +58,0 @@ if (val !== rule.len) { |
{ | ||
"name": "async-validator", | ||
"version": "1.8.2", | ||
"version": "1.8.4", | ||
"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
97170
2362