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

Commit feb1a2f

Browse files
committed
chore: use web-std blob for typeof
1 parent ded6c36 commit feb1a2f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/ipfs-core-utils/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"uint8arrays": "^2.1.6"
6060
},
6161
"devDependencies": {
62+
"@web-std/blob": "^2.1.1",
6263
"@web-std/file": "^1.1.0",
6364
"aegir": "^34.0.2",
6465
"rimraf": "^3.0.2"

packages/ipfs-core-utils/test/files/normalise-input.spec.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ const { expect } = require('aegir/utils/chai')
66
const blobToIt = require('blob-to-it')
77
const uint8ArrayFromString = require('uint8arrays/from-string')
88
const all = require('it-all')
9+
const { Blob } = require('@web-std/blob')
910
const { File } = require('@web-std/file')
10-
const { Blob, ReadableStream } = globalThis
11+
const { ReadableStream } = globalThis
1112
const { isBrowser, isWebWorker, isElectronRenderer } = require('ipfs-utils/src/env')
1213

1314
let normalise = require('../../src/files/normalise-input')
@@ -36,12 +37,7 @@ async function verifyNormalisation (input) {
3637
let content = input[0].content
3738

3839
if (isBrowser || isWebWorker || isElectronRenderer) {
39-
try {
40-
expect(content).to.be.an.instanceOf(Blob)
41-
} catch (err) {
42-
// Fallback to instance of File
43-
expect(content).to.be.an.instanceOf(File)
44-
}
40+
expect(content).to.be.an.instanceOf(Blob)
4541
content = blobToIt(content)
4642
}
4743

0 commit comments

Comments
 (0)