UNPKG

274 BPlain TextView Raw
1/**
2 * A stricter type guard.
3 * @see https://tsplay.dev/WK8zGw
4 */
5export const hasOwnProperty = <X extends {}, Y extends PropertyKey>(
6 object: X,
7 property: Y,
8): object is Record<Y, unknown> & X => {
9 return Object.prototype.hasOwnProperty.call(object, property);
10};