summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 09:41:22 +0100
committerRory& <root@rory.gay>2025-12-17 09:41:22 +0100
commit063030266015c8e265964cc487115324480c7206 (patch)
tree7977e5705cb7eb388a57177c5fcdef962c8d346c
parentPrettier u12 (diff)
downloadserver-ts-063030266015c8e265964cc487115324480c7206.tar.xz
Prettier u13
-rw-r--r--.prettierignore3
-rw-r--r--scripts/util/getRouteDescriptions.js15
2 files changed, 5 insertions, 13 deletions
diff --git a/.prettierignore b/.prettierignore

index ba87a3d9..6b5cbb33 100644 --- a/.prettierignore +++ b/.prettierignore
@@ -9,4 +9,5 @@ flake.lock 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 0372aae7..1f27141e 100644 --- a/scripts/util/getRouteDescriptions.js +++ b/scripts/util/getRouteDescriptions.js
@@ -32,10 +32,7 @@ function colorizeMethod(method) { } 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 @@ function proxy(file, apiMethod, apiPathPrefix, apiPath, ...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) => { @@ -82,8 +74,7 @@ module.exports = function getRouteDescriptions() { 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);