@iotize/cli
Version:
IoTize command line interface
15 lines • 473 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const clime_1 = require("clime");
class RegexValidator {
constructor(regex) {
this.regex = regex;
}
validate(value, context) {
if (value.match(this.regex) == null) {
throw new clime_1.ExpectedError(`Should match pattern: "${this.regex}"`);
}
}
}
exports.RegexValidator = RegexValidator;
//# sourceMappingURL=regex-validator.js.map