UNPKG

@noxfly/noxus

Version:

Simulate lightweight HTTP-like requests between renderer and main process in Electron applications with MessagePort, with structured and modular design.

16 lines (11 loc) 611 B
import type { Lifetime } from "src/DI/app-injector"; export const INJECTABLE_METADATA_KEY = Symbol("INJECTABLE_METADATA_KEY"); export function defineInjectableMetadata(target: Function, lifetime: Lifetime): void { Reflect.defineMetadata(INJECTABLE_METADATA_KEY, lifetime, target); } export function getInjectableMetadata(target: Function): Lifetime | undefined { return Reflect.getMetadata(INJECTABLE_METADATA_KEY, target) as Lifetime | undefined; } export function hasInjectableMetadata(target: Function): boolean { return Reflect.hasMetadata(INJECTABLE_METADATA_KEY, target); }