validlist

1.0.0 • Public • Published

validlist

Basic Array-based validation module

Usage

You can provide the module with an array of values. If one of the given values counts as negative (false, null, undefined, etc), false will be returned.

Example

In this example plain types are such as booleans, strings and more are being used, but you could of course fill an array with responses from functions afterwhich they can all be validated at once.

    const validate = require('validlist');
    const validation1 = [true, 1, 'string'];
    const validation2 = [true, 1, 'string', null];

    validate(validation1);      //true, no negative values.
    validate(validation2);      //false, contains null which counts as negative.

Contribution

Please make a pull request. For major changes i kindly ask you to create an issue first where in you can discuss your changes.

Licence

MPL-2.0

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i validlist

      Weekly Downloads

      0

      Version

      1.0.0

      License

      MPL-2.0

      Unpacked Size

      18.8 kB

      Total Files

      4

      Last publish

      Collaborators

      • kearfy