Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
function hasProperty
Re-export
import { hasProperty } from "https://deno.land/x/discordeno@17.2.0/plugins/permissions/deps.ts";

TS save way to check if a property exists in an object

Type Parameters

T extends { }
optional
Y extends PropertyKey = string

Parameters

obj: T
prop: Y

Returns

obj is T & Record<Y, unknown>