1.0.2 • Published 2 years ago

@kxtxr/ts-guard v1.0.2

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

@kxtxr/ts-guard

@kxtxr/ts-guard is a TypeScript utility package that provides a set of commonly used guard functions.

Installation

Install @kxtxr/ts-guard via npm:

npm install @kxtxr/ts-guard

Usage

Here is how you can use some of the guard functions:

import { isPresent, isNumber } from '@kxtxr/ts-guard';

const x: number | undefined | number | string = foo.bar;

if (isNumber(x)) {
  // x is number
}

if (isPresent(x)) {
  // x is number or string
}
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago