Skip to content

Commit 07227e2

Browse files
committed
fix: prefix stream/web import with node:
1 parent 9022f8f commit 07227e2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1818
- Run test WPT test against our impl [#109]
1919
- File name are now casted to string [#109]
2020
- Slicing in the middle of multiple parts added more bytes than what what it should have [#109]
21+
- Prefixed `stream/web` import with `node:` to allow easier static analysis detection of Node built-ins [#122]
2122

2223
## v3.1.2
2324

streams.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const POOL_SIZE = 65536;
44

55
if (!globalThis.ReadableStream) {
66
try {
7-
Object.assign(globalThis, require('stream/web'))
7+
Object.assign(globalThis, require('node:stream/web'))
88
} catch (error) {
99
// TODO: Remove when only supporting node >= 16.5.0
1010
Object.assign(globalThis, require('web-streams-polyfill/dist/ponyfill.es2018.js'))

test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ test('returns a readable stream', t => {
390390

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

0 commit comments

Comments
 (0)