Files
SnowLuma/.pnpm-store/v11/files/cd/ed6df0308c965d7fc8e403f672b73b68d45135a0fa3fd8bad5cc0159c321e24ce33078af22eb3b36e99aa386043670589c08940120e5cddda44b2eeb0cf3f0
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

31 lines
838 B
Plaintext

import { Hono } from "../../hono.js";
//#region src/helper/factory/index.ts
/**
* @module
* Factory Helper for Hono.
*/
var Factory = class {
initApp;
#defaultAppOptions;
constructor(init) {
this.initApp = init?.initApp;
this.#defaultAppOptions = init?.defaultAppOptions;
}
createApp = (options) => {
const app = new Hono(options && this.#defaultAppOptions ? {
...this.#defaultAppOptions,
...options
} : options ?? this.#defaultAppOptions);
if (this.initApp) this.initApp(app);
return app;
};
createMiddleware = (middleware) => middleware;
createHandlers = (...handlers) => {
return handlers.filter((handler) => handler !== void 0);
};
};
const createFactory = (init) => new Factory(init);
const createMiddleware = (middleware) => middleware;
//#endregion
export { Factory, createFactory, createMiddleware };