Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oasis/packages/deps.ts>hasProperty

An object oriented Discordeno framework
Latest
function hasProperty
Re-export
import { hasProperty } from "https://deno.land/x/oasis@2.1.0/packages/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>