From 22b9ea67b75d73edf6616f240bedbe6d7bf5e997 Mon Sep 17 00:00:00 2001 From: Martin DONADIEU Date: Mon, 19 Feb 2024 00:11:26 +0100 Subject: [PATCH] fix: add node prefix for util to fix issue in env with min version node 18 (#2775) * fix: add node prefix for util to fix issue in env with min version node 18 * fix: add missing prefix --- lib/fetch/body.js | 2 +- lib/fetch/util.js | 2 +- test/fetch/pull-dont-push.js | 8 ++++---- test/websocket/messageevent.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fetch/body.js b/lib/fetch/body.js index 2781a7b90d9..65fd63c5b23 100644 --- a/lib/fetch/body.js +++ b/lib/fetch/body.js @@ -17,7 +17,7 @@ const { webidl } = require('./webidl') const { Blob, File: NativeFile } = require('node:buffer') const assert = require('node:assert') const { isErrored } = require('../core/util') -const { isArrayBuffer } = require('util/types') +const { isArrayBuffer } = require('node:util/types') const { File: UndiciFile } = require('./file') const { serializeAMimeType } = require('./dataURL') const { Readable } = require('node:stream') diff --git a/lib/fetch/util.js b/lib/fetch/util.js index 82e96ec9acd..fdda578213e 100644 --- a/lib/fetch/util.js +++ b/lib/fetch/util.js @@ -8,7 +8,7 @@ const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, pa const { performance } = require('node:perf_hooks') const { isBlobLike, ReadableStreamFrom, isValidHTTPToken } = require('../core/util') const assert = require('node:assert') -const { isUint8Array } = require('util/types') +const { isUint8Array } = require('node:util/types') const { webidl } = require('./webidl') // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable diff --git a/test/fetch/pull-dont-push.js b/test/fetch/pull-dont-push.js index 5dbf331f397..58eaee3e8fd 100644 --- a/test/fetch/pull-dont-push.js +++ b/test/fetch/pull-dont-push.js @@ -3,10 +3,10 @@ const { test } = require('node:test') const assert = require('node:assert') const { fetch } = require('../..') -const { createServer } = require('http') -const { once } = require('events') -const { Readable, pipeline } = require('stream') -const { setTimeout: sleep } = require('timers/promises') +const { createServer } = require('node:http') +const { once } = require('node:events') +const { Readable, pipeline } = require('node:stream') +const { setTimeout: sleep } = require('node:timers/promises') const { closeServerAsPromise } = require('../utils/node-http') diff --git a/test/websocket/messageevent.js b/test/websocket/messageevent.js index 372cdd2ba89..e1ab3d16dd7 100644 --- a/test/websocket/messageevent.js +++ b/test/websocket/messageevent.js @@ -1,7 +1,7 @@ 'use strict' const { test } = require('node:test') -const assert = require('assert') +const assert = require('node:assert') const { MessageEvent } = require('../..') test('test/parallel/test-messageevent-brandcheck.js', () => {