Newly Potted Mandrakes

    validator.fn

    3.0.3 • Public • Published

    validator.fn Tests

    A simple function to aid form validations

    Getting Started

    Installation

    Install via Package managers such as npm or yarn

    npm install validator.fn --save
    # or
    yarn add validator.fn

    or use cdn

    Minified:

    //cdn.jsdelivr.net/npm/validator.fn@latest/validator.fn.umd.min.js

    Pretty Printed:

    //cdn.jsdelivr.net/npm/validator.fn@latest/validator.fn.umd.js

    Usage

    This library is compiled to UMD format, you should be able to use it in both Node.js and browser.

    import validate from 'validator.fn';
    
    const err = validate('hey', ['isString', 'minLength:3', 'hasLength:3']) // is valid
    
    const err = validate(3, ['isNumber', 'inRange:1-10'])
    console.log(err) // -> null

    Supported Validations

    • isString
    • isNumber
    • iSEmail
    • isRequired
    • minLength
    • maxLength
    • hasLength
    • inRange
    • hasPattern

    Install

    npm i validator.fn

    DownloadsWeekly Downloads

    4

    Version

    3.0.3

    License

    MIT

    Unpacked Size

    90.4 kB

    Total Files

    16

    Last publish

    Collaborators

    • sibiraj-s