From 2a36139930800aaaa8418bb3f143bf513dc41ae7 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Wed, 25 Sep 2024 21:52:20 +0200 Subject: [PATCH] Ignore TS issue with Bun for now --- packages/knip/src/util/file-entry-cache.ts | 1 + packages/knip/src/util/serialize.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/knip/src/util/file-entry-cache.ts b/packages/knip/src/util/file-entry-cache.ts index 75412afc4..4ec974714 100644 --- a/packages/knip/src/util/file-entry-cache.ts +++ b/packages/knip/src/util/file-entry-cache.ts @@ -122,6 +122,7 @@ export class FileEntryCache { try { const dir = dirname(this.filePath); if (!isDirectory(dir)) fs.mkdirSync(dir, { recursive: true }); + // @ts-ignore please bun fs.writeFileSync(this.filePath, serialize(this.cache)); } catch (_err) { debugLog('*', `Error writing cache to ${this.filePath}`); diff --git a/packages/knip/src/util/serialize.ts b/packages/knip/src/util/serialize.ts index c15595dea..1de98b975 100644 --- a/packages/knip/src/util/serialize.ts +++ b/packages/knip/src/util/serialize.ts @@ -8,6 +8,7 @@ if (typeof Bun !== 'undefined') { } else { const { serialize, deserialize } = await import('node:v8'); s = serialize; + // @ts-ignore please bun d = deserialize; }