Utility for checking if a key exists in an object.
Note this is a type guard, and will inform typescript that the
key definitely exists in that object.
This uses Object.hasOwn, which only checks for keys that exist
as it's own property, not inherited properties.
Utility for checking if a key exists in an object. Note this is a type guard, and will inform typescript that the key definitely exists in that object.
This uses Object.hasOwn, which only checks for keys that exist as it's own property, not inherited properties.
Returns
a boolean indicating whether the key exists
Example
Example
Example
See
MDN reference for Object.hasOwn