Skip to content

Commit 4f118d2

Browse files
committed
feat: use node:-protocol
1 parent 8907c5c commit 4f118d2

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

packages/fetch/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {builtinModules} from 'module';
1+
import {builtinModules} from 'node:module';
22
import {dependencies} from './package.json';
33

44
export default [

packages/fetch/src/body.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Body interface provides common methods for Request and Response
66
*/
77

8-
import Stream from 'stream';
9-
import {types} from 'util';
8+
import Stream from 'node:stream';
9+
import {types} from 'node:util';
1010

1111
import {FetchError} from './errors/fetch-error.js';
1212
import {FetchBaseError} from './errors/base.js';
@@ -378,8 +378,8 @@ class StreamIterableIterator {
378378
}
379379

380380
/**
381-
*
382-
* @param {any} error
381+
*
382+
* @param {any} error
383383
* @returns {Promise<IteratorResult<T, void>>}
384384
*/
385385
async throw(error) {
@@ -585,7 +585,7 @@ class StreamPump {
585585
}
586586

587587
/**
588-
* @param {Error} error
588+
* @param {Error} error
589589
*/
590590
error(error) {
591591
if (this.controller) {

packages/fetch/src/fetch.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
* All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.
77
*/
88

9-
import http from 'http';
10-
import https from 'https';
11-
import zlib from 'zlib';
12-
import fs from 'fs';
9+
import http from 'node:http';
10+
import https from 'node:https';
11+
import zlib from 'node:zlib';
12+
import fs from 'node:fs';
1313
import * as mime from 'mrmime'
1414
import dataUriToBuffer from 'data-uri-to-buffer';
15-
import {Buffer} from 'buffer';
15+
import {Buffer} from 'node:buffer';
1616

1717
import {writeToStream, fromAsyncIterable} from './body.js';
1818
import Response from './response.js';
@@ -21,8 +21,8 @@ import Request, {getNodeRequestOptions} from './request.js';
2121
import {FetchError} from './errors/fetch-error.js';
2222
import {AbortError} from './errors/abort-error.js';
2323
import {isRedirect} from './utils/is-redirect.js';
24-
import {pipeline as pump, PassThrough} from 'stream';
25-
import * as Stream from 'stream';
24+
import {pipeline as pump, PassThrough} from 'node:stream';
25+
import * as Stream from 'node:stream';
2626
import { FormData } from './package.js';
2727

2828

packages/fetch/src/headers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Headers class offers convenient helpers
55
*/
66

7-
import {types} from 'util';
8-
import http from 'http';
7+
import {types} from 'node:util';
8+
import http from 'node:http';
99
import { isIterable } from './utils/is.js'
1010

1111
/** @type {{validateHeaderValue?:(name:string, value:string) => any}} */

packages/fetch/src/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.
88
*/
99

10-
import {format as formatUrl} from 'url';
10+
import {format as formatUrl} from 'node:url';
1111
import Headers from './headers.js';
1212
import Body, {clone, extractContentType, getTotalBytes} from './body.js';
1313
import {isAbortSignal} from './utils/is.js';

packages/fetch/src/utils/form-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {randomBytes} from 'crypto';
1+
import {randomBytes} from 'node:crypto';
22
import { iterateMultipart } from '@web3-storage/multipart-parser';
33
import { FormData } from '../package.js';
44
import { isBlob } from './is.js';

packages/fetch/src/utils/is.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Stream from "stream";
1+
import Stream from "node:stream";
22

33
/**
44
* Is.js

packages/fetch/test/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import util from 'util';
1+
import util from 'node:util';
22
import {Headers} from '@remix-run/web-fetch';
33
import chai from 'chai';
44
import chaiIterator from 'chai-iterator';

packages/fetch/test/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import http from 'http';
2-
import {TextEncoder} from 'util';
1+
import http from 'node:http';
2+
import {TextEncoder} from 'node:util';
33

44
import chai from 'chai';
55
import FormData from 'form-data';

packages/fetch/test/response.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import {TextEncoder} from 'util';
2+
import {TextEncoder} from 'node:util';
33
import chai from 'chai';
44
import {Response} from '@remix-run/web-fetch';
55
import TestServer from './utils/server.js';

0 commit comments

Comments
 (0)