lakutata
Version:
An IoC-based universal application framework.
71 lines (54 loc) • 2.13 kB
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const t = require("../../../constants/DIMetadataKey.cjs");
const e = require("../../helpers/ObjectConstructor.cjs");
const r = require("../../helpers/ObjectParentConstructors.cjs");
require("../../../../vendor/Package.4.cjs");
require("../../../../vendor/Package.5.cjs");
require("../../helpers/As.cjs");
require("../../helpers/ObjectParentConstructor.cjs");
function c(c, a, n, o) {
let T;
if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c))) {
T = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c));
} else {
T = new Map;
const a = [];
r.ObjectParentConstructors(e.ObjectConstructor(c)).forEach((e => {
if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e)) a.unshift(Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e));
}));
a.forEach((t => t.forEach(((t, e) => T.set(e, t)))));
}
T.set(a, {
name: n,
transform: o
});
Reflect.defineMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, T, e.ObjectConstructor(c));
}
function a(c) {
const a = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c)) || new Map;
r.ObjectParentConstructors(e.ObjectConstructor(c)).forEach((e => {
if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e)) {
const r = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e);
r.forEach(((t, e) => {
if (a.has(e)) return;
a.set(e, t);
}));
}
}));
if (a) return a;
return new Map;
}
function n(e) {
if (!Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, e)) Reflect.defineMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, true, e);
return e;
}
function o(e) {
return !!Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, e);
}
exports.GetObjectInjectItemsByPrototype = a;
exports.GetObjectIsAutoload = o;
exports.MarkObjectAsAutoload = n;
exports.SetObjectInjectItem = c;