@vladbasin/ts-types

Various types for better typescripting

Usage no npm install needed!

<script type="module">
  import vladbasinTsTypes from 'https://cdn.skypack.dev/@vladbasin/ts-types';
</script>

README

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();