Skip to content

Commit 9bf5f22

Browse files
authoredMay 8, 2024··
feat: use utility@2 (#5312)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated Node.js versions in CI workflows to include version 22. - Removed an unused parameter in the release workflow to streamline operations. - **Refactor** - Improved code efficiency in HTTP client by using destructured imports. - **Documentation** - Updated software dependencies in `package.json` to enhance functionality and compatibility. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent ad1591b commit 9bf5f22

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed
 

‎.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
1414
with:
1515
os: 'ubuntu-latest, macos-latest, windows-latest'
16-
version: '14, 16, 18, 20'
16+
version: '14, 16, 18, 20, 22'
1717
install: 'npm i -g npminstall && npminstall'

‎.github/workflows/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ jobs:
1111
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1212
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
1313
with:
14-
checkTest: false
1514
install: 'npm install --legacy-peer-deps --no-package-lock --no-fund'

‎lib/core/dnscache_httpclient.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const dns = require('dns').promises;
1+
const dns = require('node:dns').promises;
22
const LRU = require('ylru');
3+
const { assign } = require('utility');
34
const HttpClient = require('./httpclient');
4-
const utility = require('utility');
55
const utils = require('./utils');
66

77
const IP_REGEX = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
@@ -84,7 +84,7 @@ module.exports = DNSCacheHttpClient;
8484

8585
function formatDnsLookupUrl(host, url, address) {
8686
if (typeof url === 'string') return url.replace(host, address);
87-
const urlObj = utility.assign({}, url);
87+
const urlObj = assign({}, url);
8888
urlObj.hostname = urlObj.hostname.replace(host, address);
8989
if (urlObj.host) {
9090
urlObj.host = urlObj.host.replace(host, address);

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"egg-cluster": "^2.0.0",
2929
"egg-cookies": "^2.6.1",
3030
"egg-core": "^5.4.0",
31-
"egg-development": "^2.7.0",
31+
"egg-development": "^3.0.0",
3232
"egg-errors": "^2.3.1",
3333
"egg-i18n": "^2.1.1",
3434
"egg-jsonp": "^2.0.0",
@@ -45,7 +45,7 @@
4545
"extend2": "^1.0.1",
4646
"graceful": "^1.1.0",
4747
"humanize-ms": "^1.2.1",
48-
"is-type-of": "^1.2.1",
48+
"is-type-of": "^2.1.0",
4949
"koa-bodyparser": "^4.4.1",
5050
"koa-is-json": "^1.0.0",
5151
"koa-override": "^3.0.0",
@@ -55,7 +55,7 @@
5555
"sendmessage": "^2.0.0",
5656
"urllib": "^2.33.0",
5757
"urllib-next": "npm:urllib@^3.22.4",
58-
"utility": "^1.17.0",
58+
"utility": "^2.1.0",
5959
"ylru": "^1.3.2"
6060
},
6161
"devDependencies": {

‎test/doc.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('test/doc.test.js', () => {
1818

1919
const mainNodejsVersion = parseInt(process.versions.node.split('.')[0]);
2020

21-
if (process.platform !== 'win32' && mainNodejsVersion >= 18) {
21+
if (process.platform === 'linux' && mainNodejsVersion >= 18) {
2222
const cwd = path.dirname(__dirname);
2323
const dumi = path.join(cwd, 'node_modules', '.bin', 'dumi');
2424
await runscript(`cross-env NODE_OPTIONS=--openssl-legacy-provider APP_ROOT=./site ${dumi} build`,

0 commit comments

Comments
 (0)
Please sign in to comment.