@younho9/not
v0.1.0
Published
Type guard based on exclude
Downloads
6
Maintainers
Readme
@younho9/not
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
}