const Validations = {
    REQUIRED: 'required',
    UNIQUE: 'unique',
    MIN: 'min',
    MAX: 'max',
    MINLENGTH: 'minlength',
    MAXLENGTH: 'maxlength',
    PATTERN: 'pattern',
    MINBYTES: 'minbytes',
    MAXBYTES: 'maxbytes',
};
Validations.exists = validation => Object.keys(Validations)
    .map(key => Validations[key])
    .includes(validation);
Validations.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(Validations)
    .map(key => Validations[key])
    .filter(e => typeof e === 'string');
export { Validations, SUPPORTED_VALIDATION_RULES };
export default { Validations, SUPPORTED_VALIDATION_RULES };
