xshell 1.3.51 → 1.3.52

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/file.d.ts CHANGED
@@ -282,5 +282,5 @@ export declare function fp_sorter(l: {
282
282
  fp: string;
283
283
  }, r: {
284
284
  fp: string;
285
- }): 1 | 0 | -1;
285
+ }): 0 | 1 | -1;
286
286
  export declare function log_action(action: string, fp_src: string, fp_dst: string, sep?: string): void;
package/net.d.ts CHANGED
@@ -37,7 +37,7 @@ export interface RequestOptions {
37
37
  queries?: Record<string, any>;
38
38
  headers?: Record<string, string>;
39
39
  body?: string | Record<string, any> | Uint8Array | URLSearchParams | Readable;
40
- type?: 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'application/jose+json';
40
+ type?: 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'application/jose+json' | 'text/plain';
41
41
  proxy?: boolean | ValueOf<typeof MyProxy> | string;
42
42
  encoding?: Encoding | 'binary';
43
43
  retries?: true | number;
package/net.js CHANGED
@@ -269,10 +269,16 @@ function get_request_body(body, type) {
269
269
  if (body instanceof Uint8Array)
270
270
  return body;
271
271
  check(!(body instanceof ArrayBuffer || ArrayBuffer.isView(body)));
272
- return JSON.stringify(body);
272
+ return encode(JSON.stringify(body));
273
273
  }
274
274
  if (type === 'application/x-www-form-urlencoded')
275
275
  return encode((body instanceof URLSearchParams ? body : new URLSearchParams(body)).toString());
276
+ if (type === 'text/plain') {
277
+ if (typeof body === 'string')
278
+ return encode(body);
279
+ check(body instanceof Uint8Array);
280
+ return body;
281
+ }
276
282
  check(type === 'multipart/form-data');
277
283
  // undici.FormData 会和 globalThis.FormData 不一致,禁止传入 FormData 类型
278
284
  let form = new undici.FormData();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.51",
3
+ "version": "1.3.52",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -56,9 +56,9 @@
56
56
  "@stylistic/eslint-plugin": "^5.10.0",
57
57
  "@svgr/webpack": "^8.1.0",
58
58
  "@types/sass-loader": "^8.0.10",
59
- "@typescript-eslint/eslint-plugin": "^8.57.2",
60
- "@typescript-eslint/parser": "^8.57.2",
61
- "@typescript-eslint/utils": "^8.57.2",
59
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
60
+ "@typescript-eslint/parser": "^8.58.0",
61
+ "@typescript-eslint/utils": "^8.58.0",
62
62
  "archiver": "^7.0.1",
63
63
  "chalk": "^5.6.2",
64
64
  "commander": "^14.0.3",
@@ -66,7 +66,7 @@
66
66
  "emoji-regex": "^10.6.0",
67
67
  "eslint": "^10.1.0",
68
68
  "eslint-plugin-react": "^7.37.5",
69
- "https-proxy-agent": "^8.0.0",
69
+ "https-proxy-agent": "^9.0.0",
70
70
  "i18next": "25.8.1",
71
71
  "i18next-scanner": "^4.6.0",
72
72
  "koa": "^3.2.0",
@@ -75,7 +75,7 @@
75
75
  "mime-types": "^3.0.2",
76
76
  "p-map": "^7.0.4",
77
77
  "react": "^19.2.4",
78
- "react-i18next": "^17.0.1",
78
+ "react-i18next": "^17.0.2",
79
79
  "resolve-path": "^1.4.0",
80
80
  "sass": "^1.98.0",
81
81
  "sass-loader": "^16.0.7",
@@ -86,7 +86,7 @@
86
86
  "ts-loader": "^9.5.4",
87
87
  "tslib": "^2.8.1",
88
88
  "typescript": "^6.0.2",
89
- "undici": "^7.24.6",
89
+ "undici": "^7.24.7",
90
90
  "webpack": "^5.105.4",
91
91
  "webpack-bundle-analyzer": "^5.3.0",
92
92
  "ws": "^8.20.0"
package/utils.common.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare function seq<T = number>(n: number, generator?: (index: number) =
21
21
  - mapper?: 可以是 key (string, number, symbol) 或 (obj: any) => any */
22
22
  export declare function unique<TObj>(iterable: TObj[] | Iterable<TObj>, mapper?: keyof TObj | Mapper<TObj>): TObj[];
23
23
  /** 字符串字典序比较 */
24
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
24
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
25
25
  /** 排序对象中 keys 的顺序,返回新的对象 */
26
26
  export declare function sort_keys<TObj>(obj: TObj): TObj;
27
27
  /** 比较 1.10.02 这种版本号
@@ -193,3 +193,5 @@ export declare function set_error_message(error: Error, message: string): Error;
193
193
  /** 比较两个数组中的元素完全相同,数组元素用引用比较 */
194
194
  export declare function array_equals(a: any[], b: any[]): boolean;
195
195
  export declare function nowstr(with_date?: boolean): string;
196
+ export declare function has_chinese(str: string): boolean;
197
+ export declare function fold_spaces(str: string): string;
package/utils.common.js CHANGED
@@ -634,4 +634,11 @@ export function nowstr(with_date = false) {
634
634
  const date = new Date();
635
635
  return with_date ? date.to_str() : date.to_time_str();
636
636
  }
637
+ export function has_chinese(str) {
638
+ return /[\u4E00-\u9FA5]/.test(str);
639
+ }
640
+ export function fold_spaces(str) {
641
+ return str.replaceAll(/[^\S\n]+/g, ' ')
642
+ .replaceAll(/\n(?: ?\n)+/g, '\n');
643
+ }
637
644
  //# sourceMappingURL=utils.common.js.map
package/utils.d.ts CHANGED
@@ -12,7 +12,6 @@ export declare function typed_array_to_buffer(view: ArrayBufferView): Buffer<Arr
12
12
  export declare function log_line(): void;
13
13
  export declare function sha256(data: string | Uint8Array): string;
14
14
  export declare function sha1(data: string | Uint8Array): string;
15
- export declare function has_chinese(str: string): boolean;
16
15
  export declare function escape_line_feed(str: string): string;
17
16
  /** util.inspect(obj)
18
17
  - options
package/utils.js CHANGED
@@ -37,9 +37,6 @@ export function sha256(data) {
37
37
  export function sha1(data) {
38
38
  return ncrypto.hash('sha1', data);
39
39
  }
40
- export function has_chinese(str) {
41
- return /[\u4E00-\u9FA5]/.test(str);
42
- }
43
40
  export function escape_line_feed(str) {
44
41
  return str.replace(/\n/g, '\\n');
45
42
  }