Skip to content

Commit ac7415c

Browse files
committed
Use the node: URL scheme for Node.js builtin module imports.
1 parent 13fde60 commit ac7415c

13 files changed

+21
-20
lines changed

GraphQLUpload.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

3-
import { doesNotThrow, throws } from "assert";
43
import { parseValue } from "graphql";
4+
import { doesNotThrow, throws } from "node:assert";
55

66
import GraphQLUpload from "./GraphQLUpload.mjs";
77
import Upload from "./Upload.mjs";

Upload.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { ok, rejects, strictEqual } from "assert";
3+
import { ok, rejects, strictEqual } from "node:assert";
44

55
import Upload from "./Upload.mjs";
66

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Patch
66

77
- Updated dev dependencies.
8+
- Use the `node:` URL scheme for Node.js builtin module imports.
89
- Improved JSDoc in the module `GraphQLUpload.mjs`.
910
- Revamped the readme:
1011
- Removed the badges.

graphqlUploadExpress.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual } from "assert";
43
import express from "express";
5-
import { createServer } from "http";
64
import createError from "http-errors";
5+
import { deepStrictEqual, ok, strictEqual } from "node:assert";
6+
import { createServer } from "node:http";
77
import fetch, { File, FormData } from "node-fetch";
88

99
import graphqlUploadExpress from "./graphqlUploadExpress.mjs";

graphqlUploadKoa.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @ts-check
22

3-
import { deepStrictEqual, ok, strictEqual } from "assert";
4-
import { createServer } from "http";
53
import Koa from "koa";
4+
import { deepStrictEqual, ok, strictEqual } from "node:assert";
5+
import { createServer } from "node:http";
66
import fetch, { File, FormData } from "node-fetch";
77

88
import graphqlUploadKoa from "./graphqlUploadKoa.mjs";

ignoreStream.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Safely ignores a Node.js readable stream.
5-
* @param {import("stream").Readable} stream Node.js readable stream.
5+
* @param {import("node:stream").Readable} stream Node.js readable stream.
66
*/
77
export default function ignoreStream(stream) {
88
// Prevent an unhandled error from crashing the process.

ignoreStream.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import { doesNotThrow, strictEqual } from "assert";
3+
import { doesNotThrow, strictEqual } from "node:assert";
44

55
import ignoreStream from "./ignoreStream.mjs";
66
import CountReadableStream from "./test/CountReadableStream.mjs";

processRequest.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export default function processRequest(
370370
* all resolvers have resolved, or after an error has interrupted the request.
371371
* @callback FileUploadCreateReadStream
372372
* @param {FileUploadCreateReadStreamOptions} [options] Options.
373-
* @returns {import("stream").Readable}
373+
* @returns {import("node:stream").Readable}
374374
* [Node.js readable stream](https://nodejs.org/api/stream.html#readable-streams)
375375
* of the file’s contents.
376376
* @see [Node.js `Readable` stream constructor docs](https://nodejs.org/api/stream.html#new-streamreadableoptions).
@@ -399,9 +399,9 @@ export default function processRequest(
399399
* Processes an incoming
400400
* [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec).
401401
* @callback ProcessRequestFunction
402-
* @param {import("http").IncomingMessage} request
402+
* @param {import("node:http").IncomingMessage} request
403403
* [Node.js HTTP server request instance](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
404-
* @param {import("http").ServerResponse} response
404+
* @param {import("node:http").ServerResponse} response
405405
* [Node.js HTTP server response instance](https://nodejs.org/api/http.html#http_class_http_serverresponse).
406406
* @param {ProcessRequestOptions} [options] Options.
407407
* @returns {Promise<

processRequest.test.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// @ts-check
22

3+
import { ReadStream } from "fs-capacitor";
34
import {
45
deepStrictEqual,
56
notStrictEqual,
67
ok,
78
rejects,
89
strictEqual,
910
throws,
10-
} from "assert";
11-
import { ReadStream } from "fs-capacitor";
12-
import { createServer } from "http";
11+
} from "node:assert";
12+
import { createServer } from "node:http";
1313
import fetch, { File, FormData } from "node-fetch";
1414

1515
import processRequest from "./processRequest.mjs";

test/CountReadableStream.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// @ts-check
22

3-
import { Readable } from "stream";
3+
import { Readable } from "node:stream";
44

55
/**
66
* A count readable stream, for testing purposes.
77
* @see [Example counting stream in the Node.js docs](https://nodejs.org/api/stream.html#an-example-counting-stream).
88
*/
99
export default class CountReadableStream extends Readable {
10-
/** @param {import("stream").ReadableOptions} [options] */
10+
/** @param {import("node:stream").ReadableOptions} [options] */
1111
constructor(options) {
1212
super(options);
1313
this._max = 1000000;

0 commit comments

Comments
 (0)