@younho9/not
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@younho9/not

CI XO code style Conventional Commits

Type guard based on exclude

Install

$ npm install @younho9/not

Usage

import not from '@younho9/not';

const isNullable = (value: unknown): value is null | undefined =>
	value === null || value === undefined;

const isNonNullable = not(isNullable);

declare const someValue: string | null | undefined;

if (isNonNullable(someValue)) {
	someValue;
	//=> string
}

LICENSE

MIT

Package Sidebar

Install

npm i @younho9/not

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

3.4 kB

Total Files

5

Last publish

Collaborators

  • younho9