@dooboostore/dom-render
Version:
html view template engine
21 lines • 740 B
JavaScript
import { Validator } from './Validator';
import { DomRenderProxy } from '../DomRenderProxy';
export class RegExpTestValidator extends Validator {
constructor(regexp, value, target, event, autoValid = true) {
super(value, target, event, autoValid);
this.regexp = DomRenderProxy.final(regexp);
}
valid() {
var _a;
const value = this.value;
const regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
// console.log('regexp-->', value, this.regexp, regExp.test(value))
if (value) {
return regExp.test(value);
}
else {
return false;
}
}
}
//# sourceMappingURL=RegExpTestValidator.js.map