JSPM

js-model-validation

0.0.11
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q11044F
    • License ISC

    js-model-validation is js model validation lib to validate the model property. It's allow range of property validations like 'string', 'number', 'json' etc. It's not only validate the model but also return the data from 'req.body' (if node app).

    Package Exports

    • js-model-validation

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-model-validation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    js-model-valiation

    a Js Model Validation v0.0.11 application

    How to use:

    columns
    [{
        name: 'columns name',
        type: 'column type', default set to 'string' -> [string, email, number, date, json, array]
        validation: {
            required: true, -> true or false (false will ignore all the validation for the column)
            message: '[column] is required.',
            min: 0, string or number column allowed input, default 0 when required set to true
            max: 50, string or number column allowed input, default 'max'
            rangmessage: 'min 3 and max 20', only display when min, max or min and max values are provided
        },
        nesteditems: false, default set to false, when set to true 'validationitems' need to set
            and for this 'name', 'type', validation and other attribute ignored.
        validationitems: [
            name: 'column name',
            type: 'column type',
            .....
        ]
    }]
    
    config -> config is optional
    showAllMessage: boolean -> default set to false {
        true: Display all the error messages.
        false: Display first found error messages.
    }
    
    req or validation data