You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assertDefined - Assert that the given value is defined, meaning it is not undefined.
assertPresent - Assert that the given value is present (non-nullable), meaning it is neither null or undefined.
assertError - Assert that the given value is an Error.
Improved builtin
arrayIncludes - An alternative to Array#includes() that properly acts as a type guard.
setHas - An alternative to Set#has() that properly acts as a type guard.
objectKeys - A strongly-typed version of Object.keys().
objectEntries - A strongly-typed version of Object.entries().
objectFromEntries - A strongly-typed version of Object.fromEntries().
objectHasOwn - A strongly-typed version of Object.hasOwn().
isFinite - A strongly-typed version of Number.isFinite().
isInteger - A strongly-typed version of Number.isInteger().
isSafeInteger - A strongly-typed version of Number.isSafeInteger().
FAQ
What is the difference between this and type-fest?
The type-fest package contains only types, meaning they are only used at compile-time and nothing is ever compiled into actual JavaScript code. This package contains functions that are compiled into JavaScript code and used at runtime.
Related
type-fest - A collection of essential TypeScript types