// Utility functions for validation and parsing, shared between core-types and properties
export function makeValidator(...values) {
    return function (value) {
        return values.indexOf(value) !== -1;
    };
}
export function makeParser(isValid, allowNumbers = false) {
    return function (value) {
        if (allowNumbers && typeof value === 'number') {
            return value;
        }
        if (isValid(value)) {
            return value;
        }
        throw new Error(`Invalid value: ${value}`);
    };
}
//# sourceMappingURL=validators.js.map