UNPKG

@tsed/common

Version:
35 lines 951 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.printRoutes = void 0; const logger_1 = require("@tsed/logger"); function printRoutes(routes) { const mapColor = { GET: "green", POST: "yellow", PUT: "blue", DELETE: "red", PATCH: "magenta", ALL: "cyan" }; routes = routes.map((route) => { const method = route.method.toUpperCase(); route.method = { length: method.length, toString: () => { return logger_1.colorize(method, mapColor[method]); } }; return route; }); const str = logger_1.$log.drawTable(routes, { padding: 1, header: { method: "Method", url: "Endpoint", name: "Class method" } }); return "\n" + str.trim(); } exports.printRoutes = printRoutes; //# sourceMappingURL=printRoutes.js.map