UNPKG

@busy-hour/blaze

Version:

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

16 lines (15 loc) • 624 B
// src/extractor/service/index.ts import { isNil, removeTrailingSlash } from "../../utils/common.js"; function getRestPath(service) { const version = service.version ? `v${service.version}` : ""; const restPath = typeof service.rest === "string" ? service.rest : service.name; return [version, restPath].map((val) => typeof val === "string" ? removeTrailingSlash(val) : null).filter(Boolean).join("/"); } function getServiceName(service) { const version = !isNil(service.version) ? `v${service.version}` : ""; return [version, service.name].filter(Boolean).join("."); } export { getRestPath, getServiceName };