guardObjectSomeKeys()
Last updated
Was this helpful?
Last updated
Was this helpful?
guardObjectSomeKeys()
Guards the value to be an of a generic type variable with some of its or some groups of its . The function uses to search for the .
Obj
extends
object
A generic type variable Obj
constrained by 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: Obj
keys: (keyof Obj | Array)[]
callback?: ResultCallback<Obj, { keys: typeof keys } & Payload>
payload?: Payload
value is
Obj
An of a generic type variable , by default of the type captured from itself that contains some or some of the groups of the given , to guard.
An of property names or a two-dimensional array of property names to check if the given contains some of them.
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 function.
The payload
parameter of the callback function consists of the keys
property given in the parameter, and it can't be overwritten by the given parameter of the main 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 an of a generic type variable , by default of type captured from the supplied .
The return value is a indicating whether the is an with some or some groups of the given .