Skip to content

Commit a89b06f

Browse files
chore(deps): bump undici from 5.22.1 to 5.26.2 (nervosnetwork#2879)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Keith <keithwhisper@gmail.com>
1 parent ba66f8d commit a89b06f

4 files changed

Lines changed: 32 additions & 38 deletions

File tree

packages/neuron-wallet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"sqlite3": "5.1.6",
7272
"subleveldown": "4.1.4",
7373
"typeorm": "0.2.45",
74-
"undici": "5.22.1",
74+
"undici": "5.26.2",
7575
"uuid": "8.3.2"
7676
},
7777
"devDependencies": {

packages/neuron-wallet/src/utils/ckb-rpc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ export class LightRPC extends Base {
335335
})
336336
const batchRes = await res.body.json()
337337

338+
if (!Array.isArray(batchRes)) {
339+
return []
340+
}
341+
338342
return batchRes.map((res: any, i: number) => {
339343
if (res.id !== payload[i].id) {
340344
return new IdNotMatchedInBatchException(i, payload[i].id, res.id)

packages/neuron-wallet/src/utils/rpc-request.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export const rpcRequest = async <T = any>(
2323
throw new Error(`indexer request failed with HTTP code ${res.statusCode}`)
2424
}
2525
const body = await res.body.json()
26-
return body?.result as T
26+
if (body !== null && typeof body === 'object' && 'result' in body) {
27+
return body?.result as T
28+
}
29+
return [] as T
2730
}
2831

2932
export const rpcBatchRequest = async (
@@ -50,8 +53,11 @@ export const rpcBatchRequest = async (
5053
if (res.statusCode !== 200) {
5154
throw new Error(`indexer request failed with HTTP code ${res.statusCode}`)
5255
}
53-
const responseBody: { id: number; error?: any; result: any }[] = await res.body.json()
54-
return responseBody.sort((a, b) => a.id - b.id)
56+
const responseBody = await res.body.json()
57+
if (Array.isArray(responseBody) && responseBody.every(i => 'id' in i)) {
58+
return responseBody.sort((a, b) => a.id - b.id)
59+
}
60+
return []
5561
}
5662

5763
export default {

yarn.lock

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@
13731373
dependencies:
13741374
regenerator-runtime "^0.13.11"
13751375

1376-
"@babel/runtime@^7.20.6":
1376+
"@babel/runtime@^7.22.5":
13771377
version "7.23.2"
13781378
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885"
13791379
integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==
@@ -1875,6 +1875,11 @@
18751875
resolved "https://registry.yarnpkg.com/@fal-works/esbuild-plugin-global-externals/-/esbuild-plugin-global-externals-2.1.2.tgz#c05ed35ad82df8e6ac616c68b92c2282bd083ba4"
18761876
integrity sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==
18771877

1878+
"@fastify/busboy@^2.0.0":
1879+
version "2.0.0"
1880+
resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.0.0.tgz#f22824caff3ae506b18207bad4126dbc6ccdb6b8"
1881+
integrity sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==
1882+
18781883
"@fluentui/date-time-utilities@^7.9.1":
18791884
version "7.9.1"
18801885
resolved "https://registry.yarnpkg.com/@fluentui/date-time-utilities/-/date-time-utilities-7.9.1.tgz#bb486dc0a0fff33ef5803adabbf95e2cbf4be7be"
@@ -4567,7 +4572,7 @@
45674572
"@types/history" "^4.7.11"
45684573
"@types/react" "*"
45694574

4570-
"@types/react@*", "@types/react@17.0.62", "@types/react@>=16", "@types/react@^17":
4575+
"@types/react@*", "@types/react@17.0.62", "@types/react@>=16", "@types/react@^16", "@types/react@^17":
45714576
version "17.0.62"
45724577
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.62.tgz#2efe8ddf8533500ec44b1334dd1a97caa2f860e3"
45734578
integrity sha512-eANCyz9DG8p/Vdhr0ZKST8JV12PhH2ACCDYlFw6DIO+D+ca+uP4jtEDEpVqXZrh/uZdXQGwk7whJa3ah5DtyLw==
@@ -4576,15 +4581,6 @@
45764581
"@types/scheduler" "*"
45774582
csstype "^3.0.2"
45784583

4579-
"@types/react@^16":
4580-
version "16.14.49"
4581-
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.49.tgz#79347898927bf72b758237b2da1c11efce50894d"
4582-
integrity sha512-WHKMS4fIlDpeLVKCGDs5k1MTCyqh1tyFhGqouSFgpPsCsWNDTtiMpTYUcJnHg66kp03ubqb4BFjd5+7gS3MyHw==
4583-
dependencies:
4584-
"@types/prop-types" "*"
4585-
"@types/scheduler" "*"
4586-
csstype "^3.0.2"
4587-
45884584
"@types/resolve@1.17.1":
45894585
version "1.17.1"
45904586
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
@@ -6383,13 +6379,6 @@ builtins@^5.0.0:
63836379
dependencies:
63846380
semver "^7.0.0"
63856381

6386-
busboy@^1.6.0:
6387-
version "1.6.0"
6388-
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
6389-
integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==
6390-
dependencies:
6391-
streamsearch "^1.1.0"
6392-
63936382
byte-size@8.1.1:
63946383
version "8.1.1"
63956384
resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-8.1.1.tgz#3424608c62d59de5bfda05d31e0313c6174842ae"
@@ -15275,12 +15264,12 @@ react-error-overlay@^6.0.11:
1527515264
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.11.tgz#92835de5841c5cf08ba00ddd2d677b6d17ff9adb"
1527615265
integrity sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==
1527715266

15278-
react-i18next@12.1.5:
15279-
version "12.1.5"
15280-
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.1.5.tgz#b65f5733dd2f96188a9359c009b7dbe27443f009"
15281-
integrity sha512-7PQAv6DA0TcStG96fle+8RfTwxVbHVlZZJPoEszwUNvDuWpGldJmNWa3ZPesEsZQZGF6GkzwvEh6p57qpFD2gQ==
15267+
react-i18next@12.1.5, react-i18next@>=11.16.4:
15268+
version "13.3.1"
15269+
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.3.1.tgz#9b072bf4dd4cafb028e92315a8a1415f8034bdca"
15270+
integrity sha512-JAtYREK879JXaN9GdzfBI4yJeo/XyLeXWUsRABvYXiFUakhZJ40l+kaTo+i+A/3cKIED41kS/HAbZ5BzFtq/Og==
1528215271
dependencies:
15283-
"@babel/runtime" "^7.20.6"
15272+
"@babel/runtime" "^7.22.5"
1528415273
html-parse-stringify "^3.0.1"
1528515274

1528615275
react-inspector@^6.0.0, react-inspector@^6.0.1:
@@ -16751,11 +16740,6 @@ stream-shift@^1.0.0:
1675116740
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
1675216741
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
1675316742

16754-
streamsearch@^1.1.0:
16755-
version "1.1.0"
16756-
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
16757-
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==
16758-
1675916743
string-argv@^0.3.1:
1676016744
version "0.3.2"
1676116745
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6"
@@ -17628,12 +17612,12 @@ unbox-primitive@^1.0.2:
1762817612
has-symbols "^1.0.3"
1762917613
which-boxed-primitive "^1.0.2"
1763017614

17631-
undici@5.22.1:
17632-
version "5.22.1"
17633-
resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b"
17634-
integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==
17615+
undici@5.26.2:
17616+
version "5.26.2"
17617+
resolved "https://registry.yarnpkg.com/undici/-/undici-5.26.2.tgz#fa61bfe40f732540d15e58b0c1271872d8e3c995"
17618+
integrity sha512-a4PDLQgLTPHVzOK+x3F79/M4GtyYPl+aX9AAK7aQxpwxDwCqkeZCScy7Gk5kWT3JtdFq1uhO3uZJdLtHI4dK9A==
1763517619
dependencies:
17636-
busboy "^1.6.0"
17620+
"@fastify/busboy" "^2.0.0"
1763717621

1763817622
unfetch@^4.2.0:
1763917623
version "4.2.0"
@@ -17830,7 +17814,7 @@ url-parse@^1.5.3:
1783017814
querystringify "^2.1.1"
1783117815
requires-port "^1.0.0"
1783217816

17833-
usb@^1.7.0:
17817+
usb@1.8.8, usb@^1.7.0:
1783417818
version "1.8.8"
1783517819
resolved "https://registry.yarnpkg.com/usb/-/usb-1.8.8.tgz#54de33f9e57dc4efc1b5b5f72b6624a275775e80"
1783617820
integrity sha512-xpRAoek268RE3ATqK8l6LjrF4ADHn/A3V3cXEFbYo3/D83ZCLSO0A5tFKO093F4w5IbDfBVlB9VsYzoGz6EJGw==

0 commit comments

Comments
 (0)