@arpinum/defender
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • 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:

import { assert } from "@arpinum/defender";

assert("hello").toBeANumber(); // throws: value must be a number

Simple validation returning a boolean:

import { is } from "@arpinum/defender";

is("hello").aNumber(); // false

More examples in examples.

Docs

License

MIT

/@arpinum/defender/

    Package Sidebar

    Install

    npm i @arpinum/defender

    Weekly Downloads

    89

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    7.89 kB

    Total Files

    9

    Last publish

    Collaborators

    • michaelborde