diff --git a/.prettierignore b/.prettierignore index ba87a3d..6b5cbb3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,4 +9,5 @@ extra/admin-api discord-response-samples src/util/migration/postgres-initial.ts -scripts/stagingMigrat \ No newline at end of file +scripts/stagingMigrat +temp \ No newline at end of file diff --git a/scripts/util/getRouteDescriptions.js b/scripts/util/getRouteDescriptions.js index 0372aae..1f27141 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js @@ -32,10 +32,7 @@ } function formatPath(path) { - return path - .replace(/:(\w+)/g, underline(":$1")) - .replace(/#(\w+)/g, underline("#$1")) - ; + return path.replace(/:(\w+)/g, underline(":$1")).replace(/#(\w+)/g, underline("#$1")); } /** @@ -58,12 +55,7 @@ } 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) => { @@ -82,8 +74,7 @@ currentPath = file.replace(root.slice(0, -1), ""); currentPath = currentPath.split(".").slice(0, -1).join("."); // truncate .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);