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

x/oasis/reflect-deno.ts>Reflect.getMetadataKeys

An object oriented Discordeno framework
Latest
function Reflect.getMetadataKeys
import { Reflect } from "https://deno.land/x/oasis@2.1.0/reflect-deno.ts";
const { getMetadataKeys } = Reflect;

Gets the metadata keys defined on the target object or its prototype chain.

Examples

class Example { }

// constructor result = Reflect.getMetadataKeys(Example);

Parameters

target: any

The target object on which the metadata is defined.

Returns

any[]

An array of unique metadata keys.

Gets the metadata keys defined on the target object or its prototype chain.

Examples

class Example { // property declarations are not part of ES6, though they are valid in TypeScript: // static staticProperty; // property;

static staticMethod(p) { } method(p) { } }

// property (on constructor)
result = Reflect.getMetadataKeys(Example, "staticProperty");

// property (on prototype)
result = Reflect.getMetadataKeys(Example.prototype, "property");

// method (on constructor)
result = Reflect.getMetadataKeys(Example, "staticMethod");

// method (on prototype)
result = Reflect.getMetadataKeys(Example.prototype, "method");

Parameters

target: any

The target object on which the metadata is defined.

propertyKey: string | symbol

The property key for the target.

Returns

any[]

An array of unique metadata keys.