Skip to content

Commit 6d9a3a5

Browse files
committed
Make explicit
1 parent 5fce565 commit 6d9a3a5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

js/src/comm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class ShinyComm {
3232
const msg = {
3333
content: {comm_id: this.comm_id, data: data},
3434
metadata: metadata,
35+
// TODO: need to _encode_ any buffers into base64 (JSON.stringify just drops them)
3536
buffers: buffers || [],
3637
// this doesn't seem relevant to the widget?
3738
header: {}

js/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { decode } from 'base64-arraybuffer';
55
// along to the comm logic
66
function jsonParse(x: string) {
77
const msg = JSON.parse(x);
8-
msg.buffers = msg.buffers.map((b: any) => new DataView(decode(b)));
8+
msg.buffers = msg.buffers.map((base64: string) => new DataView(decode(base64)));
99
return msg;
1010
}
1111

0 commit comments

Comments
 (0)