@radix-ui/themes
Version:
[](https://radix-ui.com/themes)
10 lines (8 loc) • 311 B
text/typescript
/** A util to check whether the object has a key, while inferring the correct key type */
function hasOwnProperty<K extends string | number | symbol>(
obj: Record<K, unknown>,
key: string | number | symbol
): key is K {
return Object.prototype.hasOwnProperty.call(obj, key);
}
export { hasOwnProperty };