Skip to content

Commit 5c298b3

Browse files
authored
remove Blob avail check
Signed-off-by: Manuel <[email protected]>
1 parent f09037f commit 5c298b3

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Adapters/Files/GridFSBucketAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class GridFSBucketAdapter extends FilesAdapter {
8181
: null;
8282

8383
// when working with a Blob, it could be over the max size of a buffer, so we need to stream it
84-
if (typeof Blob !== 'undefined' && data instanceof Blob) {
84+
if (data instanceof Blob) {
8585
let readableStream = data.stream();
8686

8787
// may come in as a web stream, so we need to convert it to a node stream

src/Routers/FilesRouter.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@ export class FilesRouter {
178178

179179
let file;
180180

181-
if (
182-
typeof Blob !== 'undefined' &&
183-
Buffer.isBuffer(req.body) &&
184-
req.body?.length >= MAX_V8_STRING_SIZE_BYTES
185-
) {
181+
if (Buffer.isBuffer(req.body) && req.body?.length >= MAX_V8_STRING_SIZE_BYTES) {
186182
file = new Parse.File(filename, new Blob([req.body]), contentType);
187183
} else {
188184
file = new Parse.File(filename, { base64: req.body.toString('base64') }, contentType);
@@ -229,7 +225,7 @@ export class FilesRouter {
229225
// update fileSize
230226
let fileData;
231227
// if the file is a blob, get the size from the blob
232-
if (typeof Blob !== 'undefined' && fileObject.file._source?.file instanceof Blob) {
228+
if (fileObject.file._source?.file instanceof Blob) {
233229
// get the size of the blob
234230
fileObject.fileSize = fileObject.file._source.file.size;
235231
// set the file data

0 commit comments

Comments
 (0)