2.0.1 • Published 3 years ago

oslllo-validator-exception v2.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

Cover Image

CI/Test 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"

Return false instead

If you want to return false instead of an exception then check out oslllo-validator HERE

npm.io