hasProperty
Documentation / @discordeno/utils / hasProperty
Function: hasProperty()
hasProperty<
T,Y>(obj,prop):obj is T & Record<Y, unknown>
Defined in: packages/utils/src/utils.ts:14
TS save way to check if a property exists in an object
Type Parameters
T
T extends object
Y
Y extends PropertyKey = string
Parameters
obj
T
prop
Y
Returns
obj is T & Record<Y, unknown>