Latest
function hasProperty
import { hasProperty } from "https://dotland.deno.dev/x/discordeno@18.0.1/plugins/fileloader/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>
import hasProperty
import { hasProperty } from "https://dotland.deno.dev/x/discordeno@18.0.1/plugins/fileloader/deps.ts";