guardObjectKeysIn()
Last updated
Was this helpful?
Last updated
Was this helpful?
guardObjectKeysIn()
Guards the value to be an of a generic type variable with specified keys in it(or its prototype chain).
Obj
extends
object
Key
extends keyof
Obj
Payload
extends
object
=
object
value: Obj
keys: Key[]
callback?: ResultCallback<Obj, { keys: typeof keys } & Payload>
payload?: Payload
value is
Obj
A generic type variable Obj
constrained by indicates captured type of the given via the and the parameter of the provided function type.
A generic type variable Key
constrained by the keyof Obj
, by default of value captured from the supplied indicates the specific property name of .
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.
An of a generic type variable Obj
, by default of the type captured from itself that contains(or its prototype chain) the given to guard.
An of property keys to check whether the given contains(or its prototype chain).
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.
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 specified in it(or its prototype chain).