Skip to main content
Module

x/reflect_metadata/mod.ts>Reflect.getOwnMetadataKeys

A Deno-compatible copy of the TypeScript Metadata Reflection API my Microsoft
Latest
function Reflect.getOwnMetadataKeys
import { Reflect } from "https://deno.land/x/reflect_metadata@v0.1.12-2/mod.ts";
const { getOwnMetadataKeys } = Reflect;

Gets the unique metadata keys defined on the target object.

Examples

class Example { }

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

Parameters

target: any

The target object on which the metadata is defined.

Returns

any[]

An array of unique metadata keys.

Gets the unique metadata keys defined on the target object.

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.getOwnMetadataKeys(Example, "staticProperty");

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

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

// method (on prototype)
result = Reflect.getOwnMetadataKeys(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.