guardPrimitive()
Last updated
Was this helpful?
Last updated
Was this helpful?
guardPrimitive()
Guards the value to be the type or the given of the .
Type
extends
Primitive
A generic type variable Type
constrained by generic type indicates captured type of the given via the and the parameter of the provided function type.
Payload
extends
object
=
object
The Payload
generic type variable constrained by indicates the type of optional parameter of the supplied function and optional parameter of the function from which it captures its value.
value: Type
type?: Primitives
callback?: ResultCallback<Type, Payload>
payload?: Payload
value is Type
The value of a generic type variable constrained by the , by default of the type captured from itself to guard.
An optional specific type of to check the given .
The optional callback of type with parameters, the that has been checked, the result
of this check, and payload
of generic type variable with optional properties from the provided payload
, to handle them before the result
return. By default, it uses resultCallback()
function.
An optional of the generic type variable is assigned to the of the given function.
The return type is a as the result of its statement indicating the is , by default of type captured from the supplied .
The return value is a indicating whether the is the type or the given of .