We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
?.
1 parent 70454d1 commit d4e48bfCopy full SHA for d4e48bf
src/DefaultBackend.js
@@ -95,7 +95,7 @@ module.exports = class DefaultBackend {
95
return this._cache.writeStat(filepath, size, opts)
96
}
97
async readFile(filepath, opts) {
98
- const encoding = typeof opts === "string" ? opts : opts?.encoding;
+ const encoding = typeof opts === "string" ? opts : opts && opts.encoding;
99
if (encoding && encoding !== 'utf8') throw new Error('Only "utf8" encoding is supported in readFile');
100
let data = null, stat = null
101
try {
0 commit comments