@fvilers/assert
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i @fvilers/assert

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

4.23 kB

Total Files

8

Last publish

Collaborators

  • fvilers