|
@@ -86,7 +86,7 @@ var FieldCheck = function () {
|
|
|
try {
|
|
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
|
var field = _step2.value;
|
|
|
- if (typeof field !== 'string' && !(field instanceof RegExp)) {
|
|
|
+ if (typeof field !== 'string' && !this._isRegExp(field)) {
|
|
|
throw new Error('checkFields item is not string or RegExp');
|
|
|
}
|
|
|
}
|
|
@@ -125,13 +125,14 @@ var FieldCheck = function () {
|
|
|
}, {
|
|
|
key: "getRuleItem",
|
|
|
value: function getRuleItem(field) {
|
|
|
+ var _this = this;
|
|
|
return _classPrivateFieldGet(this, _ruleItems).find(function (item) {
|
|
|
var _iterator4 = _createForOfIteratorHelper(item.checkFields),
|
|
|
_step4;
|
|
|
try {
|
|
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
|
var _matchKey = _step4.value;
|
|
|
- if (_matchKey instanceof RegExp) {
|
|
|
+ if (_this._isRegExp(_matchKey)) {
|
|
|
if (_matchKey.test(field)) {
|
|
|
return true;
|
|
|
}
|