const ValidationTypes = {
    REQUIRED: 'required',
    UNIQUE: 'unique',
    MIN: 'min',
    MAX: 'max',
    MINLENGTH: 'minlength',
    MAXLENGTH: 'maxlength',
    PATTERN: 'pattern',
    MINBYTES: 'minbytes',
    MAXBYTES: 'maxbytes',
};
const exists = validation => Object.keys(ValidationTypes)
    .map(key => ValidationTypes[key])
    .includes(validation);
const needsValue = validation => {
    const valuedMap = {
        required: false,
        unique: false,
        min: true,
        max: true,
        minlength: true,
        maxlength: true,
        pattern: true,
        minbytes: true,
        maxbytes: true,
    };
    return valuedMap[validation];
};
const SUPPORTED_VALIDATION_RULES = Object.keys(ValidationTypes)
    .map(key => ValidationTypes[key])
    .filter(e => typeof e === 'string');
const Validations = {
    ...ValidationTypes,
    exists,
    needsValue,
};
export { Validations, SUPPORTED_VALIDATION_RULES };
export default { Validations, SUPPORTED_VALIDATION_RULES };
