Skip to content

Commit

Permalink
fix(interactions): code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sridhar committed Aug 31, 2022
1 parent f434921 commit 6bdfb0d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
import { gunzip } from 'fflate';

export const convert = async (stream: object): Promise<Uint8Array> => {
if (!(stream instanceof Blob) && !(stream instanceof ReadableStream)) {
if (stream instanceof Blob || stream instanceof ReadableStream) {
return new Response(stream)
.arrayBuffer()
.then(buffer => new Uint8Array(buffer));
} else {
return Promise.reject('Invalid content type');
}

return new Response(stream)
.arrayBuffer()
.then(buffer => new Uint8Array(buffer));
};

export const base64ToArrayBuffer = (base64: string): Uint8Array => {
Expand Down

0 comments on commit 6bdfb0d

Please sign in to comment.