Skip to content

Commit fabf146

Browse files
authored
Merge pull request #91 from vrugtehagel/main
Read cached files as text unless type is "buffer"
2 parents 69e363e + 9b52b45 commit fabf146

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/FileCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class FileCache {
188188
// have to read the entire contents via JSON.parse (or otherwise) to check the cache validity.
189189
this.#counts.read++;
190190
let type = metadata?.type || this.getType();
191-
let data = fs.readFileSync(this.contentsPath);
191+
let data = fs.readFileSync(this.contentsPath, type !== "buffer" ? "utf8" : null);
192192
if (type === "json" || type === "parsed-xml") {
193193
data = JSON.parse(data);
194194
}

0 commit comments

Comments
 (0)