Ghustavh97 / validator-exception

All in one Javascript validator but throws an exception on false

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cover Image

build npm Coverage Status

Documentation, Installation, and Usage Instructions

This package is a wrapper for oslllo-validator therefore shares the same documentaion with it.

See the full installation and usage documentation HERE.

The Objective

Create an all in one Javascript validator that throws an exception on false.

The Problem / Why This Was Created

It was requested HERE

Usage Examples

Check if value is actual NaN

const assert = require("oslllo-validator-exception");

assert.actualNaN(NaN); // => True
assert.actualNaN(null); // => Throws Error
assert.actualNaN(undefined); // => Throws Error

Check if value is actual NaN but throw an exception with a custom message on false

const assert = require("oslllo-validator-exception");

assert.actualNaN(null, assert.msg("Invalid UUID")); // => Throws Error with custom message "Invalid UUID"

About

All in one Javascript validator but throws an exception on false

License:MIT License


Languages

Language:JavaScript 98.5%Language:HTML 1.5%