• Stars
    star
    400
  • Rank 107,843 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ”© The missing TypeScript utils

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:



Make sure your zod schema exactly matches a given type:

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

More Repositories

1

denoify

πŸ¦•For NPM module authors that would like to support Deno but do not want to write and maintain a port.
TypeScript
929
star
2

tss-react

✨ Dynamic CSS-in-TS solution, based on Emotion
TypeScript
631
star
3

evt

πŸ’§EventEmitter's typesafe replacement
TypeScript
427
star
4

ts-ci

πŸš€ A starter for TS projects meant to be published on NPM.
TypeScript
321
star
5

i18nifty

🌎 Type safe React i18n library
TypeScript
146
star
6

clean-architecture

πŸ“ A clean architecture framework
TypeScript
47
star
7

run_exclusive

βš‘πŸ”’ Wait queue for function execution πŸ”’ ⚑
TypeScript
28
star
8

powerhooks

A collection of powerfull react hooks
TypeScript
26
star
9

chan-dongle-extended

An extention for chan_dongle: PIN codes, multipart SMS, contacts.
TypeScript
23
star
10

keycloakify-advanced-starter

A starter and demo project for Keycloakify v6 - Component level customization.
TypeScript
17
star
11

keycloakify-starter

A starter and demo project for Keycloakify v6 - CSS level customization.
TypeScript
10
star
12

chan-dongle-extended-pages

Shell
6
star
13

my_dummy_npm_and_deno_module

Example/tutorial on how to setup denoify
TypeScript
6
star
14

github-pages-plugin-for-type-route

Feature create-react-app/type-route/gh-pages compatibility
JavaScript
5
star
15

denoify_ci

βœ… Continuous integration setup for modules using denoify
TypeScript
5
star
16

nextra-dsfr-demo

A demo project for nextra-theme-dsfr-docs
TypeScript
4
star
17

ts-promisify

Module to help work in sequencial mode with typeScript thanks to async/await
TypeScript
3
star
18

fp-ts-test-ci

test ci
TypeScript
3
star
19

asterisk

Fork of Asterisk 14.5. Version exploited by Semasim.
C
3
star
20

resume

Curriculum Vitae of Joseph Garrone
HTML
3
star
21

fuzzy-octo-guacamole

A playground for testing CI setup that deploys on Deno and NPM
TypeScript
3
star
22

ts-async-agi

Async agi implementation for node targeting typescript users ( fork from agi-node )
JavaScript
2
star
23

releases

2
star
24

working_environnement

My vim plugins, vimrc and bashrc
Vim Script
2
star
25

react-dsfr-next-demo

πŸš€ Starter Next + react-dsfr + MUI + TSS
TypeScript
2
star
26

ts-ami

An Asterisk manager API client
TypeScript
2
star
27

www.semasim.com

HTML
1
star
28

test-repo

Description changed
1
star
29

semasim-backend

TypeScript
1
star
30

react-screen-scaler

πŸ–₯οΈπŸ” Design Once, Render Everywhere: Screen-size agnostic React development for uniform environments
TypeScript
1
star
31

ts-sip

A collection of low lever tools to work with the SIP protocol.
TypeScript
1
star
32

node-remove-photo-duplicate

A script to remove duplicate of the same photos
JavaScript
1
star
33

evt_react_hooks_todo_list

Created with StackBlitz ⚑️
TypeScript
1
star
34

dark-mode-ssr-demo

Demo of how to have dark mode + SSR without white flash.
CSS
1
star
35

chan-dongle-extended-client

https://garronej.github.io/chan-dongle-extended-pages/
TypeScript
1
star
36

mui-next-appdir-demo

MUI Next AppDir demo (using tss-react tooling)
TypeScript
1
star
37

evt.land

Landing page for the EVT project
EJS
1
star
38

crypto-lib

TypeScript
1
star
39

vigilant-doodle

TypeScript
1
star
40

semasim-gateway

TypeScript
1
star
41

keycloakify-demo-app-css-only

FreeMarker
1
star