From 0a8ceb9e6349284e75545a01ffad608b020f78e2 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Mon, 11 Dec 2023 01:12:54 +0100 Subject: Actually run prettier --- scripts/util/getRouteDescriptions.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'scripts/util/getRouteDescriptions.js') diff --git a/scripts/util/getRouteDescriptions.js b/scripts/util/getRouteDescriptions.js index a79dac96..12fc61e5 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js @@ -15,10 +15,7 @@ let currentPath = ""; const proxy = (file, method, prefix, path, ...args) => { const opts = args.find((x) => x?.prototype?.OPTS_MARKER == true); - if (!opts) - return console.error( - `${file} has route without route() description middleware`, - ); + if (!opts) return console.error(`${file} has route without route() description middleware`); console.log(prefix + path + " - " + method); opts.file = file.replace("/dist/", "/src/").replace(".js", ".ts"); @@ -26,12 +23,7 @@ const proxy = (file, method, prefix, path, ...args) => { }; express.Router = () => { - return Object.fromEntries( - methods.map((method) => [ - method, - proxy.bind(null, currentFile, method, currentPath), - ]), - ); + return Object.fromEntries(methods.map((method) => [method, proxy.bind(null, currentFile, method, currentPath)])); }; RouteUtility.route = (opts) => { @@ -50,8 +42,7 @@ module.exports = function getRouteDescriptions() { currentPath = file.replace(root.slice(0, -1), ""); currentPath = currentPath.split(".").slice(0, -1).join("."); // trancate .js/.ts file extension of path currentPath = currentPath.replaceAll("#", ":").replaceAll("\\", "/"); // replace # with : for path parameters and windows paths with slashes - if (currentPath.endsWith("/index")) - currentPath = currentPath.slice(0, "/index".length * -1); // delete index from path + if (currentPath.endsWith("/index")) currentPath = currentPath.slice(0, "/index".length * -1); // delete index from path try { require(file); -- cgit 1.4.1