tsafe
denoify
Our great sponsors
tsafe | denoify | |
---|---|---|
11 | 7 | |
384 | 918 | |
- | - | |
6.7 | 7.2 | |
3 months ago | 3 months ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tsafe
-
Ensure you never forget a case in a switch
Hello, This is a use case for tsafe, a utility that let you make assertions on types.
- tsafe enables to unit test your types.
-
Ensure a Zod validator actually valid given type.
Zod is a solution for generating validators. I used to be reluctant to use it because I like to declare my types with the TypeScript syntax. I am not satisfied by getting the type inferred from the validator. The solution I found is to use tsafe, a utility that enables to make sure that two types are equals. With this solution you'll have to declare your type twice, once with the TypeScript syntax and once when declaring your zod parser but you are garentied that if you update your type and forget to update the corresponding zod parser your app won't build.
-
GitLanding: A beautiful landing page for your Github project in a matter of minutes.
tsafe.dev
-
How to Troubleshoot Types?
Hi, Checkout tsafe. It enables to test types definition. Checkout this GIF in particular. Let's say for example that we have an objectFromEntries function and we want to test it typewise, we can do: ```typescript import { objectEntries } from "../myObjectFromEntries"; import { assert } from "tsafe";
-
Object.fromEntries() with a return type more precise than just { [k: sting]: any; } 🥳
`Object.fromEntries()`, `Object.entries()` and `Object.keys()` are barely usable when in a TypeScript codebase because their return type are very vague. [tsafe](https://github.com/garronej/tsafe) features three new utilities: [objectFromEntries()](https://docs.tsafe.dev/objectfromentries), [objectEntries()](https://docs.tsafe.dev/objectentries) and [objectKeys()](https://docs.tsafe.dev/objectkeys), functionally equivalent to their built-in counterpart but featuring much better return types.
- tsafe: The missing TypeScript builtins
- tsafe: A powerful TypeScript assertion function
-
tsafe: A new assertion function for TypeScript
Three GIFs to convince you that you need tsafe in your life:
denoify
-
Node.js vs. Deno vs. Bun: JavaScript runtime comparison
If you’re building packages/libraries for the community to use you can take a look at Denoify. It’s a project that aims to change some of your files automatically when migrating and make it easier to maintain the project for both npm and deno.land/x.
-
Build package for NPM & Deno
I do Node-first packages and use https://github.com/garronej/denoify to produce deno-compatible code. (example: https://github.com/mxxii/leac )
-
Incomplete list of npm packages adapted for Deno
You can use https://github.com/garronej/denoify for Node-first packages.
-
Ensure you never forget a case in a switch
Or use ts-patten it's comming to Deno soon (thanks to Denoify).
-
Maybe it's time to give Denoify another try. It's much more capable now than when it was first introduced.
So, if you tried Denoify in the past and it didn't work for you, maybe it will now. If you need a hand, I'm happy to help. Just ask anything on the newly opened discussion section of the github repo.
-
λ "Functions all the way down" data validation for JavaScript and TypeScript, now available for deno
It has zero dependencies so was very easy to dual publish on both npm and deno.land using denoify. Literally just needed to add the .ts extension to imports.
What are some alternatives?
type-fest - A collection of essential TypeScript types
nx - Smart Monorepos · Fast CI
tss-react - ✨ Dynamic CSS-in-TS solution, based on Emotion
dnt - Deno to npm package build tool.
eslint-plugin-total-functions - An ESLint plugin to enforce the use of total functions (and prevent the use of partial functions) in TypeScript.
ts-pattern - 🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
react-dsfr - 🇫🇷 Design system React toolkit
clean-architecture - 📐 A clean architecture framework
domain-functions - Decouple your business logic from your framework. With first-class type inference from end to end.
gitlanding - ✒️ React components for creating landingpages
rescript-compiler - The compiler for ReScript.