tsafe
GitHub
Search
⌃
K
Links
👋
What is tsafe?
⚙
How to import
UnionToIntersection
assert
id
is
Equals
symToStr
ReturnType
Parameters
Param0
objectKeys
exclude
typeGuard
capitalize/uncapitalize
Extends
Not
MethodNames
isPromiseLike
flip
objectEntries
objectFromEntries
🚧
withDefaults
📉
UnpackPromise
Powered By
GitBook
Equals
Let you test if two types are the same
Implement compile time unit testing
Playground
A less trivial example:
The code
and it's
corresponding test file
.
If you are writing tests for your type, you definitely want to checkout
//@ts-expect-error
Making sure all properties of an object are deconstructed
Playground
Making sure all cases of a switch are dealt with
Playground
Guaranteeing that a zod schema matches a given type
Playground
Previous
is
Next
symToStr
Last modified
2mo ago