1.0.0 • Published 5 years ago

data-columns v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Data Columns

Build Status Contributions Welcome

This package contains objects to help describe columns, including the validation and sanitation for the data of those columns.

const Column = require('data-column').Column;

let column = Column.populate({
    type: 'string',
    name: 'first_name',
    label: 'First Name',
    description: 'The users first name.',
    required: true,
    sanitizers: [{
        name: 'string'
    }],
    validators: [{
        name: 'string',
        options: {
            required: true,
            length: {
                min: 3,
                max: 24,
                message: 'Your name must be in between {min} and {max} characters.'
            }
        }
    }]
});