Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
docs: add
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghustavh97 committed Sep 28, 2020
1 parent 830d2a7 commit 1fbcab1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

![Cover Image](docs/images/cover.png)

[![build](https://img.shields.io/travis/oslllo/validator-exception)](https://travis-ci.org/github/oslllo/validator-exception)
[![npm](https://img.shields.io/npm/v/oslllo-validator-exception)](https://www.npmjs.com/package/oslllo-validator-exception)
[![Coverage Status](https://img.shields.io/coveralls/github/oslllo/validator-exception)](https://coveralls.io/github/oslllo/validator-exception?branch=master)

## Documentation, Installation, and Usage Instructions

> This package is a wrapper for [oslllo-validator](https://www.npmjs.com/package/oslllo-validator) therefore share the same documentaion with it.
See the full installation and usage documentation [HERE](https://docs.oslllo.com/validator/master/).

## 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](https://github.com/oslllo/validator/issues/2)

### Usage Examples

#### Check if value is actual NaN

```js
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`

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

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

```

---
Binary file added docs/images/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1fbcab1

Please sign in to comment.