Skip to content

Commit

Permalink
using v4
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmywarting committed Sep 7, 2021
1 parent 46476fa commit 46f0623
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
}
],
"dependencies": {
"web-streams-polyfill": "^3.0.3"
"web-streams-polyfill": "^4.0.0-beta.1"
}
}
2 changes: 1 addition & 1 deletion streams.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (!globalThis.ReadableStream) {
Object.assign(globalThis, require('stream/web'))
} catch (error) {
// TODO: Remove when only supporting node >= 16.5.0
Object.assign(globalThis, require('web-streams-polyfill/dist/ponyfill.es2018.js'))
require('web-streams-polyfill/polyfill')
}
}

Expand Down
6 changes: 2 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,7 @@ test('returns a readable stream', t => {
t.true(typeof stream.getReader === 'function');
});

test('checking instanceof blob#stream', async t => {
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const {ReadableStream} = await import('stream/web').catch(_ => import('web-streams-polyfill/dist/ponyfill.es2018.js'));
test('checking instanceof blob#stream', t => {
const stream = new File([], '').stream();
t.true(stream instanceof ReadableStream);
t.true(stream instanceof globalThis.ReadableStream);
});

0 comments on commit 46f0623

Please sign in to comment.