UNPKG

@busy-hour/blaze-types

Version:

<h1 align='center'>🔥 Blaze Types</h1> <div align='center'> An event driven framework for 🔥 Hono.js </div>

68 lines (67 loc) • 1.46 kB
// src/utils/module.ts import path from "node:path"; var TsModule = class { $ts; $tsInfo; $rootPath; $config; $outputPath; constructor() { this.$ts = null; this.$tsInfo = null; this.$rootPath = null; this.$config = null; this.$outputPath = null; } setModule(typescript) { this.$ts = typescript; } getModule() { if (!this.$ts) { throw new Error("[Blaze Types]: ts module is not set"); } return this.$ts; } setTsInfo(info) { this.$tsInfo = info; } getTsInfo() { if (!this.$tsInfo) { throw new Error("[Blaze Types]: ts info is not set"); } return this.$tsInfo; } setRootPath(rootPath) { this.$rootPath = rootPath; } getRootPath() { if (!this.$rootPath) { throw new Error("[Blaze Types]: root path is not set"); } return this.$rootPath; } setConfig(config) { this.$config = config; this.$outputPath = path.join(this.getRootPath(), config.outputPath); } getConfig() { if (!this.$config) { throw new Error("[Blaze Types]: config is not set"); } return this.$config; } getOutputPath() { if (!this.$outputPath) { throw new Error("[Blaze Types]: output path is not set"); } return this.$outputPath; } logger(msg) { const tsInfo = this.getTsInfo(); tsInfo.project.projectService.logger.info(`[Blaze Types]: ${msg}`); } }; var tsModule = new TsModule(); export { tsModule };