Skip to content

Commit

Permalink
Workaround for Buffer.subarray not working as expected in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Aug 23, 2019
1 parent ef524dd commit 4098041
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/utils/serialize.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src.ts/utils/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class BinaryWriter {
}

private write_buffer(buffer: Buffer) {
this.buf = Buffer.concat([this.buf.subarray(0, this.length), buffer, Buffer.alloc(INITIAL_LENGTH)]);
this.buf = Buffer.concat([Buffer.from(this.buf.subarray(0, this.length)), buffer, Buffer.alloc(INITIAL_LENGTH)]);
this.length += buffer.length;
}

Expand Down

0 comments on commit 4098041

Please sign in to comment.