UNPKG

egg

Version:

A web application framework for Node.js

25 lines (24 loc) • 577 B
import assert from "node:assert"; //#region src/lib/core/base_hook_class.ts var BaseHookClass = class { #instance; constructor(instance) { this.#instance = instance; } get logger() { return this.#instance.logger; } get config() { return this.#instance.config; } get app() { assert(this.#instance.type === "application", "agent boot should not use app instance"); return this.#instance; } get agent() { assert(this.#instance.type === "agent", "app boot should not use agent instance"); return this.#instance; } }; //#endregion export { BaseHookClass };