

GitHub - garronej/tsafe: The missing TypeScript builtins
source link: https://github.com/garronej/tsafe
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A collection of utilities to step up your TypeScript game
Three GIFs to convince you that you need tsafe
in your life
Assert thing you know are true, get runtime error if you where wrong:
Test the type definitions of your APIs:
Make TypeScript believe whatever you say:
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
.
Installation
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
Recommend
-
45
Vim-Complimentary Complimentary improves the completion of VimL builtin functions, commands, variables and options.
-
36
Embedded builtins 2018-08-14admin
-
30
README.md Boltons boltons should be builtins.
-
14
Tauthon Tauthon is a backwards-compatible fork of the Python 2.7.17 interpreter with new syntax, builtins, and libraries backported from Python 3.x. Python code and C-extensions targeting Python 2.7 or below...
-
14
Safely bundle server environment variable into react apps Motivation We want to be able to do that docker run --env FOO="xyz" my-org/my-app then access FOO in the app like proce...
-
141
garronej/tss-react: ✨ makeStyles is dead, long live makeStyles! ✨ README.md
-
9
Use environment variables in create-react-app projects
-
8
Toolkit for implementing clean architecture using Redux
-
9
garronej/ts-ci main
-
2
Repository files navigation One-size-fit-all web design: Screen-size agnostic development environment. screen-scaler.mp4
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK