Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-native/Libraries/Blob/FileReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class FileReader extends EventTarget {
const base64 = text.split(',')[1];
const typedArray = toByteArray(base64);

// $FlowFixMe[incompatible-type]
this._result = typedArray.buffer;
this._setReadyState(DONE);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('binaryToBase64', () => {
it('should encode an ArrayBuffer', () => {
const bytes = new TextEncoder().encode('Test string');

// $FlowFixMe[incompatible-type]
expect(decodeBase64(binaryToBase64(bytes.buffer))).toEqual(
Array.from(bytes),
);
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/Libraries/WebSocket/WebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ class WebSocket extends EventTarget {
let data: Blob | BlobData | ArrayBuffer | string = ev.data;
switch (ev.type) {
case 'binary':
// $FlowFixMe[incompatible-type]
data = base64.toByteArray(ev.data).buffer;
break;
case 'blob':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ const WebSocketInterceptor = {
) {
return `ArrayBuffer {${String(Array.from(new Uint8Array(value)))}}`;
}
// $FlowFixMe[incompatible-type]
return value;
},

Expand Down
Loading