diff --git a/scripts/furni-diagnose-now.ts b/scripts/furni-diagnose-now.ts index 9232e38b..43402953 100644 --- a/scripts/furni-diagnose-now.ts +++ b/scripts/furni-diagnose-now.ts @@ -97,7 +97,7 @@ async function main(): Promise { const dbByClass = new Map(baseRows.map((r) => [r.itemName, r.id])); const dbById = new Map(baseRows.map((r) => [r.id, r.itemName])); let fdWrongId = 0; - let fdIdConflict = 0; // id belongs to a different classname in DB + let _fdIdConflict = 0; // id belongs to a different classname in DB let fdMissingInDb = 0; const fdExamplesWrong: string[] = []; for (const e of entries) { @@ -114,7 +114,7 @@ async function main(): Promise { ); continue; } - if (dbById.get(e.id) !== e.classname) fdIdConflict++; + if (dbById.get(e.id) !== e.classname) _fdIdConflict++; } console.log( ` furnidata entries whose id != items_base.id for same classname: ${fdWrongId}`, diff --git a/scripts/sync-nitro-urls.cjs b/scripts/sync-nitro-urls.cjs index 539d00b6..1b98cb4b 100644 --- a/scripts/sync-nitro-urls.cjs +++ b/scripts/sync-nitro-urls.cjs @@ -24,9 +24,7 @@ const FILES = [ ]; function env(name) { - return process.env[name] && process.env[name].length - ? process.env[name] - : null; + return process.env[name]?.length ? process.env[name] : null; } function applyOverrides(data) { diff --git a/src/lib/services/swf/conversion-worker.ts b/src/lib/services/swf/conversion-worker.ts index 4188b170..cdd1edef 100644 --- a/src/lib/services/swf/conversion-worker.ts +++ b/src/lib/services/swf/conversion-worker.ts @@ -31,21 +31,21 @@ if (parentPort) { try { if (msg.type === "convert") { const result = convertSwfToNitro(msg.buffer, msg.classname); - parentPort!.postMessage({ + parentPort?.postMessage({ id: msg.id, ok: true, result, } satisfies WorkerResponse); } else { const icon = extractIconFromSwf(msg.buffer, msg.classname); - parentPort!.postMessage({ + parentPort?.postMessage({ id: msg.id, ok: true, icon: icon ?? null, } satisfies WorkerResponse); } } catch (err) { - parentPort!.postMessage({ + parentPort?.postMessage({ id: msg.id, ok: false, error: (err as Error).message, diff --git a/src/lib/utils/runtime-path.ts b/src/lib/utils/runtime-path.ts index 2871b97f..3a95e090 100644 --- a/src/lib/utils/runtime-path.ts +++ b/src/lib/utils/runtime-path.ts @@ -1,4 +1,4 @@ -import path from "path"; +import path from "node:path"; export function getRuntimePath(...segments: string[]): string { const resolvePath = new Function("p", "segs", "return p.join(...segs)");