UNPKG

@nova-ts/core

Version:

A serverside framework used to build scalable application

30 lines (28 loc) 801 B
import { ConfigLoader } from "./chunk-VUR3D4HI.js"; import { NovaConstant } from "./chunk-INEUQFI4.js"; // src/Utils/NovaPropertyLoader.ts function InjectValues(instance) { const prototype = Object.getPrototypeOf(instance); const rootPath = Reflect.getMetadata(NovaConstant.NovaValueMeta, prototype); if (rootPath) { const configObject = ConfigLoader.get(rootPath); if (configObject && typeof configObject === "object") { Object.assign(instance, configObject); } } for (const key of Object.keys(instance)) { const valuePath = Reflect.getMetadata(NovaConstant.NovaValueMeta, prototype, key); if (valuePath) { instance[key] = ConfigLoader.get(valuePath); } } return instance; } export { InjectValues }; //# sourceMappingURL=chunk-S6NJK4CW.js.map