alaska-field-text
Advanced tools
Comparing version 0.11.12 to 0.11.15
@@ -25,2 +25,5 @@ // @flow | ||
createFilter(filter: Object): any|void { | ||
if (filter instanceof RegExp) { | ||
return filter; | ||
} | ||
let exact = true; | ||
@@ -30,2 +33,5 @@ let inverse = false; | ||
if (typeof filter === 'object') { | ||
if (filter.$not || filter.$in || filter.$nin) { | ||
return filter; | ||
} | ||
value = filter.value; | ||
@@ -40,3 +46,3 @@ //默认精确 | ||
if (exact) { | ||
result = new RegExp('^' + utils.escapeRegExp(value) + '$', 'i'); | ||
result = value; | ||
} else { | ||
@@ -43,0 +49,0 @@ result = new RegExp(utils.escapeRegExp(value), 'i'); |
{ | ||
"name": "alaska-field-text", | ||
"version": "0.11.12", | ||
"version": "0.11.15", | ||
"description": "Alaska text field", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -66,8 +66,11 @@ // @flow | ||
this.setState({ error: false }); | ||
let filter: Alaska$filter = { value }; | ||
let filter: Alaska$filter = { value, exact: false }; | ||
if (mode !== 2) { | ||
//不是包含:精确匹配 | ||
filter.exact = true; | ||
} | ||
if (inverse) { | ||
if (!inverse) { | ||
// $Flow | ||
filter = value; | ||
} | ||
} else if (inverse) { | ||
filter.inverse = true; | ||
@@ -74,0 +77,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
9397
287