Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit ded6c36

Browse files
committed
chore: validate blob/file have a stream property
1 parent c5e02da commit ded6c36

File tree

1 file changed

+4
-2
lines changed
  • packages/ipfs-core-utils/src/files/normalise-input

1 file changed

+4
-2
lines changed

packages/ipfs-core-utils/src/files/normalise-input/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ function isBytes (obj) {
1010

1111
/**
1212
* @param {any} obj
13-
* @returns {obj is Blob}
13+
* @returns {obj is globalThis.Blob}
1414
*/
1515
function isBlob (obj) {
16-
return obj.constructor && (obj.constructor.name === 'Blob' || obj.constructor.name === 'File')
16+
return obj.constructor &&
17+
(obj.constructor.name === 'Blob' || obj.constructor.name === 'File') &&
18+
typeof obj.stream === 'function'
1719
}
1820

1921
/**

0 commit comments

Comments
 (0)