Skip to content

Commit

Permalink
fix: sab thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnaya committed Sep 12, 2019
1 parent a75c8b6 commit dc47346
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/internal/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ export function readEntry(
cursor += Uint16Array.BYTES_PER_ELEMENT;

entry.value = textDecoder.decode(
dataView.buffer.slice(cursor, cursor + stringLength)
// this wrapping is needed until:
// https://github.com/whatwg/encoding/issues/172
new Uint8Array(dataView.buffer.slice(cursor, cursor + stringLength))
);

cursor += stringLength;
Expand Down Expand Up @@ -207,7 +209,11 @@ export function readEntry(
// eslint-disable-next-line no-case-declarations
const objectPropsValue: ObjectPropEntry["value"] = {
key: textDecoder.decode(
dataView.buffer.slice(cursor, cursor + keyStringLength)
// this wrapping is needed until:
// https://github.com/whatwg/encoding/issues/172
new Uint8Array(
dataView.buffer.slice(cursor, cursor + keyStringLength)
)
),
value: dataView.getUint32(cursor + keyStringLength),
next: dataView.getUint32(
Expand Down

0 comments on commit dc47346

Please sign in to comment.