tsafe
v1.8.12
Published
A collection of utilities to step up your TypeScript game
Readme
Motivations
Powerful TypeScript features like assertion functions or user-defined type guards are only useful if paired with utility functions.
TypeScript, however, only exports type helpers (e.g. Record, ReturnType, etc.).
This module provides «the missing builtins» such as the assert function and other utilities that cannot be just type helpers.
Installation
tsafe is both an NPM and a Deno module.
(Achieved with denoify)
Import in deno:
import { assert, type Equals, ... } from "https://deno.land/x/tsafe/mod.ts";Install elsewhere:
$ npm install --save tsafe