Repository
Current version released
4 years ago
Versions
- v1.7.5Latest
- v1.7.5-rc.0
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.4-rc.1
- v1.6.4-rc.0
- v1.6.3
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.3
- v1.4.2
- v1.4.2-rc.4
- v1.4.2-rc.3
- v1.4.2-rc.1
- v1.4.2-rc.0
- v1.4.1
- v1.4.0
- v1.4.0-rc.1
- v1.4.0-rc.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.3-rc.0
- v1.2.0-beta.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v0.10.1
- v0.10.0
- v0.9.1
- v0.9.0
- v0.8.1
- v0.8.0
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
A collection of utilities that makes your TS code safer and cleaner
Motivation
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 corrects frustrating aspects of default utility type such as ReturnType
.
tsafe
is both an NPM and a Deno module.
(Achieved with denoify)
Import in deno:
import { assert, typeGuard, ... } from "https://deno.land/x/tsafe/mod.ts";
Install elsewhere:
$ npm install --save tsafe
#OR
$ yarn add tsafe