npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@arpinum/defender

1.0.1 • Public • Published

@arpinum/defender Build Status

Every absurdity has a champion to defend it.
Oliver Goldsmith

@arpinum/defender is a collection of assertions to do some runtime type checking.

Installation

npm install @arpinum/defender --save

Examples

Assertion throwing exception when not satisfied:

const { assert } = require('@arpinum/defender');
 
assert('hello').toBeANumber(); // throws: value must be a number

Simple validation returning a boolean:

const { is } = require('../build');
 
is('hello').aNumber(); // false

More examples in examples.

Docs

License

MIT

install

npm i @arpinum/defender

Downloadsweekly downloads

124

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability