2.0.0 • Published 2 years ago

@fvilers/assert v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@fvilers/assert

A TypeScript type guard to asserts that the given value is not undefined nor null

Installation

npm install @fvilers/assert

or

yarn add @fvilers/assert

ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

Usage

import { assert } from "@fvilers/assert";

const foo = null;

assert(foo);

Will throw an error

Uncaught Error: `value` is null
2.0.0

2 years ago

1.0.0

3 years ago