Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 721 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 721 Bytes

ts-types

Useful types for better typescript coding

Install

npm install @vladbasin/ts-types --save

Getting Started

Wrap value into Maybe to explicitly identify it can be undefined

import { Maybe } from "@vladbasin/ts-types"

Maybe<T> maybeValue = getValueWhichMightBeUndefined();

Wrap value into Nullable to explicitly identify it can be null

import { Nullable } from "@vladbasin/ts-types"

Nullable<T> maybeValue = getValueWhichMightBeNull();

Wrap value into MaybeNullable to explicitly identify it can be null or also undefined

import { MaybeNullable } from "@vladbasin/ts-types"

MaybeNullable<T> maybeValue = getValueWhichMightBeNullOrUndefined();