diff --git a/README.md b/README.md index 663e895..3f8e403 100644 --- a/README.md +++ b/README.md @@ -791,7 +791,7 @@ un.get('/user/12345', { }); ``` -如果你追求语义化,可以使用导出的和挂载的状态码、[statuses](https://github.com/jshttp/statuses)、[http-status-codes](https://github.com/prettymuchbryce/http-status-codes) 或 [node-http-status](https://github.com/adaltas/node-http-status)。 +如果你追求语义化,可以使用导出的和挂载的状态码、[statuses-es](https://github.com/esm-ts/statuses-es)、[http-status-codes](https://github.com/prettymuchbryce/http-status-codes) 或 [node-http-status](https://github.com/adaltas/node-http-status)。 ```typescript import { un, HttpStatusCode } from '@uni-helper/uni-network'; diff --git a/docs/advanced/handling-errors.md b/docs/advanced/handling-errors.md index da37ee7..1aca2b9 100644 --- a/docs/advanced/handling-errors.md +++ b/docs/advanced/handling-errors.md @@ -35,7 +35,7 @@ un.get('/user/12345', { }); ``` -如果你追求语义化,可以使用导出的和挂载的状态码、[statuses](https://github.com/jshttp/statuses)、[http-status-codes](https://github.com/prettymuchbryce/http-status-codes) 或 [node-http-status](https://github.com/adaltas/node-http-status)。 +如果你追求语义化,可以使用导出的和挂载的状态码、[statuses-es](https://github.com/esm-ts/statuses-es)、[http-status-codes](https://github.com/prettymuchbryce/http-status-codes) 或 [node-http-status](https://github.com/adaltas/node-http-status)。 ```typescript import { un, HttpStatusCode } from '@uni-helper/uni-network'; diff --git a/packages/core/package.json b/packages/core/package.json index 84e42bc..be51631 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -73,10 +73,9 @@ "dependencies": { "@dcloudio/types": "^3.4.8", "@types/lodash.merge": "^4.6.9", - "@types/statuses": "^2.0.5", "fast-querystring": "^1.1.2", "lodash.merge": "^4.6.2", - "statuses": "^2.0.1", + "statuses-es": "^2.0.6", "vue-demi": "^0.14.8" }, "devDependencies": { diff --git a/packages/core/src/adapters/download.ts b/packages/core/src/adapters/download.ts index 131ae1e..a3fcbfe 100644 --- a/packages/core/src/adapters/download.ts +++ b/packages/core/src/adapters/download.ts @@ -1,4 +1,4 @@ -import statuses from "statuses"; +import statuses from "statuses-es"; import type { UnCancelTokenListener } from "../core/UnCancelToken"; import { UnCanceledError } from "../core/UnCanceledError"; import { settle } from "../core/settle"; diff --git a/packages/core/src/adapters/request.ts b/packages/core/src/adapters/request.ts index d5941a1..75e81d7 100644 --- a/packages/core/src/adapters/request.ts +++ b/packages/core/src/adapters/request.ts @@ -1,4 +1,4 @@ -import statuses from "statuses"; +import statuses from "statuses-es"; import type { UnCancelTokenListener } from "../core/UnCancelToken"; import { UnCanceledError } from "../core/UnCanceledError"; import { settle } from "../core/settle"; diff --git a/packages/core/src/adapters/upload.ts b/packages/core/src/adapters/upload.ts index d0d6c8a..3c61a38 100644 --- a/packages/core/src/adapters/upload.ts +++ b/packages/core/src/adapters/upload.ts @@ -1,4 +1,4 @@ -import statuses from "statuses"; +import statuses from "statuses-es"; import type { UnCancelTokenListener } from "../core/UnCancelToken"; import { UnCanceledError } from "../core/UnCanceledError"; import { settle } from "../core/settle"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac09d21..86f9257 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,9 +80,6 @@ importers: '@types/lodash.merge': specifier: ^4.6.9 version: 4.6.9 - '@types/statuses': - specifier: ^2.0.5 - version: 2.0.5 '@vue/composition-api': specifier: ^1.0.0 version: 1.7.2(vue@3.4.38(typescript@5.5.4)) @@ -92,9 +89,9 @@ importers: lodash.merge: specifier: ^4.6.2 version: 4.6.2 - statuses: - specifier: ^2.0.1 - version: 2.0.1 + statuses-es: + specifier: ^2.0.6 + version: 2.0.6 vue-demi: specifier: ^0.14.8 version: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.38(typescript@5.5.4)))(vue@3.4.38(typescript@5.5.4)) @@ -906,24 +903,28 @@ packages: engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [musl] '@biomejs/cli-linux-arm64@1.8.3': resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] + libc: [glibc] '@biomejs/cli-linux-x64-musl@1.8.3': resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [musl] '@biomejs/cli-linux-x64@1.8.3': resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] + libc: [glibc] '@biomejs/cli-win32-arm64@1.8.3': resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==} @@ -2130,46 +2131,55 @@ packages: resolution: {integrity: sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.21.2': resolution: {integrity: sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.21.2': resolution: {integrity: sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.21.2': resolution: {integrity: sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-powerpc64le-gnu@4.21.2': resolution: {integrity: sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.21.2': resolution: {integrity: sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.21.2': resolution: {integrity: sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.21.2': resolution: {integrity: sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.21.2': resolution: {integrity: sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.21.2': resolution: {integrity: sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==} @@ -2285,9 +2295,6 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} - '@types/statuses@2.0.5': - resolution: {integrity: sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==} - '@types/ungap__url-search-params@0.1.2': resolution: {integrity: sha512-2WalOb9LMBR83pNXKHl3Uv8kk/uUHPXHqnENizNOvsnJ806EbcRuBAYg/WT94bzv6EK0Oo3WTiAZx5L7W/H2JQ==} @@ -5402,6 +5409,10 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + statuses-es@2.0.6: + resolution: {integrity: sha512-MNbejKdhYUwxsiupoRli1XOb9WSaGLtoE6130mfjAXjHp5AV3cCdCTYzRbIV1qXLXq1uRHvs5J9jmR3tPZKDqw==} + engines: {node: '>= 0.8'} + statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} @@ -8979,8 +8990,6 @@ snapshots: '@types/stack-utils@2.0.3': {} - '@types/statuses@2.0.5': {} - '@types/ungap__url-search-params@0.1.2': {} '@types/unist@3.0.3': {} @@ -12471,6 +12480,8 @@ snapshots: stackback@0.0.2: {} + statuses-es@2.0.6: {} + statuses@2.0.1: {} std-env@3.7.0: {}