From 9b52b457e1bf00d716064322bead78fe3e9f22e1 Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Thu, 11 Jun 2026 14:01:25 +0200 Subject: [PATCH] Read files as text unless type is "buffer" --- src/FileCache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FileCache.js b/src/FileCache.js index ca6c7c2..9d548ab 100644 --- a/src/FileCache.js +++ b/src/FileCache.js @@ -188,7 +188,7 @@ class FileCache { // have to read the entire contents via JSON.parse (or otherwise) to check the cache validity. this.#counts.read++; let type = metadata?.type || this.getType(); - let data = fs.readFileSync(this.contentsPath); + let data = fs.readFileSync(this.contentsPath, type !== "buffer" ? "utf8" : null); if (type === "json" || type === "parsed-xml") { data = JSON.parse(data); }