Skip to content

Commit

Permalink
Merge pull request #289 from falcon027/patch-1
Browse files Browse the repository at this point in the history
Replaced .toString with TextEncoder
  • Loading branch information
kriszyp authored Apr 12, 2024
2 parents 9fa48f6 + 9730c1d commit 75bf493
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion read.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ export function addReadMethods(
},
getRange(options) {
let iterable = new RangeIterable();
let textDecoder = new TextDecoder()
if (!options) options = {};
let includeValues = options.values !== false;
let includeVersions = options.versions;
Expand Down Expand Up @@ -741,7 +742,7 @@ export function addReadMethods(
? Uint8ArraySlice.call(bytes, 0, lastSize)
: bytes;
else {
value = bytes.toString('utf8', 0, lastSize);
value = textDecoder.decode(Uint8ArraySlice.call(bytes, 0, lastSize));
if (store.encoding == 'json' && value)
value = JSON.parse(value);
}
Expand Down

0 comments on commit 75bf493

Please sign in to comment.