summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 09:37:51 +0100
committerRory& <root@rory.gay>2025-12-17 09:37:51 +0100
commitc18c8502d1784a91f3e081759b7feb0677ad87a3 (patch)
treea842381653452ead1ffbd8b6ed8fe27425bd925a /scripts
parentPrettier u10 (diff)
downloadserver-ts-c18c8502d1784a91f3e081759b7feb0677ad87a3.tar.xz
Prettier u11
Diffstat (limited to 'scripts')
-rw-r--r--scripts/openapi.js11
-rw-r--r--scripts/schema.js7
2 files changed, 15 insertions, 3 deletions
diff --git a/scripts/openapi.js b/scripts/openapi.js

index ab7de525..39396d8d 100644 --- a/scripts/openapi.js +++ b/scripts/openapi.js
@@ -243,7 +243,16 @@ async function main() { fs.writeFileSync(openapiPath, JSON.stringify(specification, null, 4).replaceAll("#/definitions", "#/components/schemas").replaceAll("bigint", "number")); console.log("Wrote OpenAPI specification to", openapiPath); - console.log("Specification contains", Object.keys(specification.paths).length, "paths and", Object.keys(specification.components.schemas).length, "schemas in", Number(totalSw.elapsed().totalMilliseconds + "." + totalSw.elapsed().microseconds), "ms."); + const elapsedMs = Number(totalSw.elapsed().totalMilliseconds + "." + totalSw.elapsed().microseconds); + console.log( + "Specification contains", + Object.keys(specification.paths).length, + "paths and", + Object.keys(specification.components.schemas).length, + "schemas in", + elapsedMs, + "ms.", + ); } main(); diff --git a/scripts/schema.js b/scripts/schema.js
index d123ad8b..1779c8d6 100644 --- a/scripts/schema.js +++ b/scripts/schema.js
@@ -237,7 +237,9 @@ async function main() { mergeDefs(name, part); const elapsed = schemaSw.getElapsedAndReset(); - process.stdout.write("Done in " + yellowBright(elapsed.totalMilliseconds + "." + elapsed.microseconds) + " ms, " + yellowBright(JSON.stringify(part).length) + " bytes (unformatted) "); + process.stdout.write( + "Done in " + yellowBright(elapsed.totalMilliseconds + "." + elapsed.microseconds) + " ms, " + yellowBright(JSON.stringify(part).length) + " bytes (unformatted) ", + ); if (elapsed.totalMilliseconds >= 20) console.log(bgRedBright("\x1b[5m[SLOW]\x1b[25m")); else console.log(); @@ -307,7 +309,8 @@ async function main() { fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4)); fs.writeFileSync(__dirname + "/schemaExclusions.json", JSON.stringify(exclusionList, null, 4)); - console.log("\nSuccessfully wrote", Object.keys(definitions).length, "schemas to", schemaPath, "in", Number(totalSw.elapsed().totalMilliseconds + "." + totalSw.elapsed().microseconds), "ms,", fs.statSync(schemaPath).size, "bytes."); + const elapsedMs = Number(totalSw.elapsed().totalMilliseconds + "." + totalSw.elapsed().microseconds); + console.log("\nSuccessfully wrote", Object.keys(definitions).length, "schemas to", schemaPath, "in", elapsedMs, "ms,", fs.statSync(schemaPath).size, "bytes."); } function deleteOneOfKindUndefinedRecursive(obj, path) {