Skip to content

Commit 333b129

Browse files
committed
f
1 parent cfa7cdd commit 333b129

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"test": "npm run lint -- --fix && vitest run",
4040
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --test-timeout 180000 keep-alive-header.test.ts",
4141
"test-node16": "node examples/httpclient.cjs && node examples/search_github.cjs && node examples/timing.cjs",
42-
"cov": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16.cjs\" vitest run --coverage",
42+
"cov": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16-18.cjs\" vitest run --coverage",
4343
"ci": "npm run lint && npm run cov && npm run prepublishOnly && npm pack && attw --pack",
4444
"clean": "rm -rf dist && tsc -b --clean",
4545
"prepublishOnly": "npm run build"
@@ -74,6 +74,7 @@
7474
"iconv-lite": "^0.6.3",
7575
"proxy": "^1.0.2",
7676
"selfsigned": "^2.4.1",
77+
"string.prototype.towellformed": "^1.0.2",
7778
"tar-stream": "^2.2.0",
7879
"tshy": "^3.0.0",
7980
"tshy-after": "^1.0.0",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ const crypto = require('node:crypto');
1111
if (typeof crypto.getRandomValues !== 'function') {
1212
crypto.getRandomValues = crypto.webcrypto.getRandomValues.bind(crypto.webcrypto);
1313
}
14+
15+
// undici@v7 require String.prototype.toWellFormed, patch on Node.js 16 and 18
16+
if (typeof String.prototype.toWellFormed !== 'function') {
17+
require('string.prototype.towellformed/auto');
18+
}

0 commit comments

Comments
 (0)