All Projects β†’ garronej β†’ tsafe

garronej / tsafe

Licence: MIT license
πŸ”© The missing TypeScript utils

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tsafe

kyuko
Fast and easy http framework for Deno Deploy πŸ¦•
Stars: ✭ 18 (-93.68%)
Mutual labels:  deno
SacredUtils
Configuration utility for Sacred & Sacred Underworld with Material Design. Abandoned 05/07/2020.
Stars: ✭ 27 (-90.53%)
Mutual labels:  utilities
http4ts
Server as a Function http toolkit for TypeScript & JavaScript
Stars: ✭ 30 (-89.47%)
Mutual labels:  deno
deno-mongo-api
Example for building REST APIS with deno and MongoDB
Stars: ✭ 17 (-94.04%)
Mutual labels:  deno
cotton
SQL Database Toolkit for Deno
Stars: ✭ 129 (-54.74%)
Mutual labels:  deno
rebellion
A collection of core libraries for Racket
Stars: ✭ 78 (-72.63%)
Mutual labels:  utilities
dpytools
Collection of easy to use, beginner friendly but powerful, orthogonal tools to speed up discord bots development (discord.py)
Stars: ✭ 23 (-91.93%)
Mutual labels:  utilities
vault
A typed, persistent store for values of arbitrary types
Stars: ✭ 55 (-80.7%)
Mutual labels:  type-safety
roku-libs
Compilation of utilities for Roku development
Stars: ✭ 47 (-83.51%)
Mutual labels:  utilities
dataStructure
Implement different Data Structures using TypeScript and JavaScript. Deno Third-party Module.
Stars: ✭ 24 (-91.58%)
Mutual labels:  deno
regbits
C++ templates for type-safe bit manipulation
Stars: ✭ 53 (-81.4%)
Mutual labels:  type-safety
reno
A thin, testable routing library designed to sit on top of Deno's standard HTTP module
Stars: ✭ 127 (-55.44%)
Mutual labels:  deno
crypto
πŸ” Fastest crypto library for Deno written in pure Typescript. AES, Blowfish, CAST5, DES, 3DES, HMAC, HKDF, PBKDF2
Stars: ✭ 40 (-85.96%)
Mutual labels:  deno
justjavac
justjavac's modules
Stars: ✭ 15 (-94.74%)
Mutual labels:  deno
JimmysUnityUtilities
A bunch of code I like to have on hand while working in Unity
Stars: ✭ 93 (-67.37%)
Mutual labels:  utilities
AloeDB
Light, Embeddable, NoSQL database for Deno πŸ¦•
Stars: ✭ 111 (-61.05%)
Mutual labels:  deno
node2deno
Deno for Node.js developers
Stars: ✭ 19 (-93.33%)
Mutual labels:  deno
youtube-sr
Simple library for Node, Deno & Bun to make YouTube search easily
Stars: ✭ 68 (-76.14%)
Mutual labels:  deno
deno registry2
The backend for the deno.land/x service
Stars: ✭ 79 (-72.28%)
Mutual labels:  deno
denocker
A Docker client library for Deno
Stars: ✭ 23 (-91.93%)
Mutual labels:  deno

A collection of utilities to take your TypeScript development up a notch


(you can cherrypick what you import)

Documentation

A few GIFs to convince you that you need tsafe in your life


Assert things you know are true, get runtime errors where you were wrong:



Implement compile time unit testing



Playground



Make sure all properties of an object are deconstructed


Playground



Make sure you never forget a case in a switch


Playground



Make TypeScript believe whatever you say without having to write const obj2 = obj as Bar.
The more powerfully is to be able to tell TypeScript that obj ist not of type Bar:

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 corrects frustrating aspects of default utility types such as ReturnType.

Documentation website

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].