xshell 1.3.55 → 1.3.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/net.browser.d.ts CHANGED
@@ -33,7 +33,7 @@ export interface RequestError extends Error {
33
33
  /**
34
34
  - url: 可以只有 pathname 部分
35
35
  - options?:
36
- - method?: `有 body 时为 POST, 否则为 GET` 'GET' | 'POST' | ···
36
+ - method?: `有 body 时为 POST, 否则为 GET` 'GET' | 'POST' | ··
37
37
  - queries?: 添加到 url 上的参数,是 Record<string, any>,true/false 会被转换为 0/1
38
38
  - headers?: http 请求头 (Record<string, string> 或者 Headers 类型),其中 key 必须是小写的
39
39
  - body?: http 请求体,可以是 string, Record<string, any> (会自动 JSON.stringify), ArrayBuffer(View), Blob,
package/net.d.ts CHANGED
@@ -76,7 +76,7 @@ export declare class StatusCodeError extends Error {
76
76
  /**
77
77
  - url: 必须是完整 url
78
78
  - options?:
79
- - method?: `有 body 时为 POST, 否则为 GET` 'GET' | 'POST' | ···
79
+ - method?: `有 body 时为 POST, 否则为 GET` 'GET' | 'POST' | ··
80
80
  - queries?: 添加到 url 上的参数,是 Record<string, any>,true/false 会被转换为 0/1
81
81
  - headers?: http 请求头,是 Record<string, string>,其中 key 必须是小写的
82
82
  - body?: http 请求体,可以是:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.55",
3
+ "version": "1.3.57",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -55,9 +55,9 @@
55
55
  "@stylistic/eslint-plugin": "^5.10.0",
56
56
  "@svgr/webpack": "^8.1.0",
57
57
  "@types/sass-loader": "^8.0.10",
58
- "@typescript-eslint/eslint-plugin": "^8.58.1",
59
- "@typescript-eslint/parser": "^8.58.1",
60
- "@typescript-eslint/utils": "^8.58.1",
58
+ "@typescript-eslint/eslint-plugin": "^8.58.2",
59
+ "@typescript-eslint/parser": "^8.58.2",
60
+ "@typescript-eslint/utils": "^8.58.2",
61
61
  "archiver": "^7.0.1",
62
62
  "chalk": "^5.6.2",
63
63
  "commander": "^14.0.3",
@@ -74,7 +74,7 @@
74
74
  "mime-types": "^3.0.2",
75
75
  "p-map": "^7.0.4",
76
76
  "react": "^19.2.5",
77
- "react-i18next": "^17.0.2",
77
+ "react-i18next": "^17.0.3",
78
78
  "resolve-path": "^1.4.0",
79
79
  "sass": "^1.99.0",
80
80
  "sass-loader": "^16.0.7",
@@ -85,8 +85,8 @@
85
85
  "ts-loader": "^9.5.7",
86
86
  "tslib": "^2.8.1",
87
87
  "typescript": "^6.0.2",
88
- "undici": "^8.0.3",
89
- "webpack": "^5.106.1",
88
+ "undici": "^8.1.0",
89
+ "webpack": "^5.106.2",
90
90
  "webpack-bundle-analyzer": "^5.3.0",
91
91
  "ws": "^8.20.0"
92
92
  },
@@ -102,7 +102,7 @@
102
102
  "@types/node": "^25.6.0",
103
103
  "@types/react": "^19.2.14",
104
104
  "@types/tough-cookie": "^4.0.5",
105
- "@types/vscode": "^1.115.0",
105
+ "@types/vscode": "^1.116.0",
106
106
  "@types/webpack-bundle-analyzer": "^4.7.0",
107
107
  "@types/ws": "^8.18.1"
108
108
  }
package/utils.d.ts CHANGED
@@ -54,6 +54,8 @@ export declare class DecoderStream extends Transform {
54
54
  _transform(chunk: Uint8Array, encoding: BufferEncoding, callback: TransformCallback): void;
55
55
  _flush(callback: TransformCallback): void;
56
56
  }
57
+ /** 返回一个 transform 流,来截取可读流的前 nbytes 字节 */
58
+ export declare function slice_stream(nbytes: number): Transform;
57
59
  /** 根据 range 生成整数序列 (iterable)
58
60
  - range: 取值为逗号分割的多个可用值或值区间 (不能含有空格),比如:`8321,8322,8300-8310,11000-11999`
59
61
  - reverse?: `false` 在 range 内从后往前生成 */
package/utils.js CHANGED
@@ -3,7 +3,7 @@ import util from 'node:util';
3
3
  import ncrypto from 'node:crypto';
4
4
  import "./prototype.js";
5
5
  import "./platform.js";
6
- import { assert, decode, defer } from "./utils.common.js";
6
+ import { assert, check, decode, defer } from "./utils.common.js";
7
7
  export * from "./utils.common.js";
8
8
  /** `180` 输出字符宽度 */
9
9
  export const output_width = 180;
@@ -137,6 +137,23 @@ export class DecoderStream extends Transform {
137
137
  callback();
138
138
  }
139
139
  }
140
+ /** 返回一个 transform 流,来截取可读流的前 nbytes 字节 */
141
+ export function slice_stream(nbytes) {
142
+ let remaining = nbytes;
143
+ return new Transform({
144
+ transform(chunk, encoding, callback) {
145
+ if (chunk.length < remaining) {
146
+ remaining -= chunk.length;
147
+ callback(null, chunk);
148
+ return;
149
+ }
150
+ // 最后一块
151
+ check(chunk.length === remaining, '可读流最后一块大小应该不超过 remaining');
152
+ this.push(chunk);
153
+ callback(null, null);
154
+ }
155
+ });
156
+ }
140
157
  /** 根据 range 生成整数序列 (iterable)
141
158
  - range: 取值为逗号分割的多个可用值或值区间 (不能含有空格),比如:`8321,8322,8300-8310,11000-11999`
142
159
  - reverse?: `false` 在 range 内从后往前生成 */