UNPKG

@iotize/cli

Version:
15 lines 527 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const clime_1 = require("clime"); class InListValidator { constructor(values) { this.values = values; } validate(value, context) { if (this.values.indexOf(value) === -1) { throw new clime_1.ExpectedError(`"${value}" is not valid. It should be one of the following value: ${this.values.join(', ')}`); } } } exports.InListValidator = InListValidator; //# sourceMappingURL=in-list.js.map