UNPKG

@iotize/cli

Version:
15 lines 473 B
"use strict"; 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