import { Reflect } from "https://deno.land/x/oasis@2.1.0/reflect-deno.ts";
const { hasOwnMetadata } = Reflect;
Gets a value indicating whether the target object has the provided metadata key defined.
Examples
class Example {
}
class Example { }
// constructor result = Reflect.hasOwnMetadata("custom:annotation", Example);
Gets a value indicating whether the target object has the provided metadata key defined.
Examples
class Example {
// property declarations are not part of ES6, though they are valid in TypeScript:
// static staticProperty;
// property;
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.hasOwnMetadata("custom:annotation", Example, "staticProperty");
// property (on prototype)
result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
// method (on constructor)
result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
// method (on prototype)
result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");