This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a year ago (1.0.6)
default
Type guard functions
f
array
Applies a type guard to each element of an array and returns a new array of the specified type.
v
boolean
Type guard for boolean type.
T
Constructor
No documentation available
v
func
Type guard for function type.
f
instanceOf
Checks if a value is an instance of a given constructor.
f
litteral
Type guard function that checks if the given value is equal to the inner constant value.
v
number
Type guard for number type.
f
object
Creates a type guard function that validates an object based on the provided inner type guards.
f
optional
Creates a type guard that checks if a value is of type T or undefined.
v
string
Type guard for string type.
v
symbol
Type guard for symbol type.
T
TypeGuard
TypeGuard is a type alias representing a function that takes an unknown value and returns a value of type T.
v
undef
Type guard for undefined type.