Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/discordeno_patched/template/beginner/deps.ts>hasProperty

Discord API library for Node and Deno
Go to Latest
function hasProperty
Re-export
import { hasProperty } from "https://deno.land/x/discordeno_patched@18.0.2/template/beginner/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>