import { Reflect } from "https://dotland.deno.dev/x/alosaur@v0.35.0/src/injection/reflect.ts";
const { hasMetadata } = Reflect;
Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
Gets a value indicating whether the target object or its prototype chain 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.hasMetadata("custom:annotation", Example, "staticProperty");
// property (on prototype)
result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
// method (on constructor)
result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
// method (on prototype)
result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");