xdash / isKeyOf
Function: isKeyOf()
isKeyOf<
T
>(value
,obj
):value is keyof T
Determines if a value is a key of an object.
Type parameters
• T extends object
Parameters
• value: unknown
value to check
• obj: T
object to check if the value is a key of
Returns
value is keyof T
true if the value is a key of the object, false otherwise