xshell 1.0.116 → 1.0.118

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -53,14 +53,14 @@
53
53
  ]
54
54
  },
55
55
  "dependencies": {
56
- "@babel/core": "^7.24.6",
57
- "@babel/parser": "^7.24.6",
58
- "@babel/traverse": "^7.24.6",
56
+ "@babel/core": "^7.24.7",
57
+ "@babel/parser": "^7.24.7",
58
+ "@babel/traverse": "^7.24.7",
59
59
  "@koa/cors": "^5.0.0",
60
60
  "@types/ws": "^8.5.10",
61
- "@typescript-eslint/eslint-plugin": "^7.11.0",
62
- "@typescript-eslint/parser": "^7.11.0",
63
- "@typescript-eslint/utils": "^7.11.0",
61
+ "@typescript-eslint/eslint-plugin": "^7.12.0",
62
+ "@typescript-eslint/parser": "^7.12.0",
63
+ "@typescript-eslint/utils": "^7.12.0",
64
64
  "@xterm/addon-fit": "^0.10.0",
65
65
  "@xterm/addon-web-links": "^0.11.0",
66
66
  "@xterm/addon-webgl": "^0.18.0",
@@ -75,7 +75,7 @@
75
75
  "colors": "^1.4.0",
76
76
  "commander": "^12.1.0",
77
77
  "emoji-regex": "^10.3.0",
78
- "eslint": "^9.3.0",
78
+ "eslint": "^9.4.0",
79
79
  "eslint-plugin-import": "^2.29.1",
80
80
  "eslint-plugin-react": "^7.34.2",
81
81
  "gulp-sort": "^2.0.0",
@@ -91,12 +91,12 @@
91
91
  "ora": "^8.0.1",
92
92
  "react": "^18.3.1",
93
93
  "react-i18next": "^14.1.2",
94
- "react-object-model": "^1.2.5",
94
+ "react-object-model": "^1.2.6",
95
95
  "resolve-path": "^1.4.0",
96
96
  "strip-ansi": "^7.1.0",
97
97
  "through2": "^4.0.2",
98
98
  "tough-cookie": "^4.1.4",
99
- "tslib": "^2.6.2",
99
+ "tslib": "^2.6.3",
100
100
  "typescript": "^5.4.5",
101
101
  "ua-parser-js": "^2.0.0-beta.2",
102
102
  "undici": "^6.18.2",
@@ -105,7 +105,7 @@
105
105
  "ws": "^8.17.0"
106
106
  },
107
107
  "devDependencies": {
108
- "@babel/types": "^7.24.6",
108
+ "@babel/types": "^7.24.7",
109
109
  "@types/ali-oss": "^6.16.11",
110
110
  "@types/archiver": "^6.0.2",
111
111
  "@types/babel__traverse": "^7.20.6",
@@ -118,7 +118,7 @@
118
118
  "@types/koa-compress": "^4.0.6",
119
119
  "@types/lodash": "^4.17.4",
120
120
  "@types/mime-types": "^2.1.4",
121
- "@types/node": "^20.12.13",
121
+ "@types/node": "^20.14.2",
122
122
  "@types/react": "^18.3.3",
123
123
  "@types/through2": "^2.0.41",
124
124
  "@types/tough-cookie": "^4.0.5",
package/path.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare function extname(path: string): string;
54
54
  /** `/` */
55
55
  export declare const sep = "/";
56
56
  /** The platform-specific file delimiter. ';' or ':'. */
57
- export declare const delimiter: ";" | ":";
57
+ export declare const delimiter: ":" | ";";
58
58
  /** Returns an object from a path string - the opposite of format().
59
59
  @param path path to evaluate.
60
60
  @throws {TypeError} if `path` is not a string. */
@@ -81,7 +81,7 @@ export declare let path: {
81
81
  basename: typeof basename;
82
82
  extname: typeof extname;
83
83
  sep: string;
84
- delimiter: ";" | ":";
84
+ delimiter: ":" | ";";
85
85
  parse: typeof parse;
86
86
  format: typeof format;
87
87
  toNamespacedPath: typeof toNamespacedPath;
package/repl.js CHANGED
@@ -33,12 +33,7 @@ export async function start_repl() {
33
33
  name: 'repl',
34
34
  http: true,
35
35
  http_port: 8421,
36
- funcs: {
37
- echo({ data: [data] }) {
38
- console.log('echo:', data);
39
- return [data];
40
- },
41
- }
36
+ funcs: {}
42
37
  });
43
38
  await server.start();
44
39
  })(),
@@ -8,7 +8,9 @@ export declare function log<T>(obj: T): T;
8
8
  export declare function seq<T = number>(n: number, generator?: (index: number) => T): T[];
9
9
  /** 将 keys, values 数组按对应的顺序组合成一个对象 */
10
10
  export declare function zip_object<TValue>(keys: (string | number)[], values: TValue[]): Record<string, TValue>;
11
- export declare function delay(milliseconds: number): Promise<void>;
11
+ export declare function delay(milliseconds: number, { signal }?: {
12
+ signal?: AbortSignal;
13
+ }): Promise<void>;
12
14
  export declare class TimeoutError extends Error {
13
15
  constructor(message?: string, options?: ErrorOptions);
14
16
  }
@@ -63,7 +65,7 @@ export declare function encode(str: string): Uint8Array;
63
65
  在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
64
66
  export declare function decode(buffer: Uint8Array): string;
65
67
  /** 字符串字典序比较 */
66
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
68
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
67
69
  /** 比较 1.10.02 这种版本号 */
68
70
  export declare function vercmp(l: string, r: string): number;
69
71
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
package/utils.browser.js CHANGED
@@ -27,9 +27,18 @@ export function zip_object(keys, values) {
27
27
  return obj;
28
28
  }, {});
29
29
  }
30
- export async function delay(milliseconds) {
31
- return new Promise(resolve => {
32
- setTimeout(resolve, milliseconds);
30
+ export async function delay(milliseconds, { signal } = {}) {
31
+ signal?.throwIfAborted();
32
+ return new Promise((resolve, reject) => {
33
+ function on_signal_abort() {
34
+ clearTimeout(timeout);
35
+ reject(signal.reason);
36
+ }
37
+ signal?.addEventListener('abort', on_signal_abort);
38
+ let timeout = setTimeout(() => {
39
+ signal?.removeEventListener('abort', on_signal_abort);
40
+ resolve();
41
+ }, milliseconds);
33
42
  });
34
43
  }
35
44
  export class TimeoutError extends Error {
package/utils.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  /// <reference types="node" resolution-mode="require"/>
3
3
  /// <reference types="node" resolution-mode="require"/>
4
+ /// <reference types="node" resolution-mode="require"/>
4
5
  import { Writable, Transform, type Readable, type Duplex, type TransformCallback } from 'stream';
5
6
  import util from 'util';
7
+ import type { TimerOptions } from 'timers';
6
8
  import type Vinyl from 'vinyl';
7
9
  import './prototype.js';
8
10
  export declare const noop: () => void;
@@ -39,7 +41,7 @@ export declare function filter_values<TObj extends Record<string, any>>(obj: TOb
39
41
  /** 忽略对象中的 keys, 返回新对象 */
40
42
  export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
41
43
  /** 字符串字典序比较 */
42
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
44
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
43
45
  /** 比较 1.10.02 这种版本号 */
44
46
  export declare function vercmp(l: string, r: string): number;
45
47
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
@@ -66,7 +68,7 @@ export declare class Timer {
66
68
  print(): void;
67
69
  }
68
70
  export declare function log_line(): void;
69
- export declare function delay(milliseconds: number): Promise<void>;
71
+ export declare function delay(milliseconds: number, options?: TimerOptions): Promise<void>;
70
72
  export declare class TimeoutError extends Error {
71
73
  constructor(message?: string, options?: ErrorOptions);
72
74
  }
package/utils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Stream, Writable, Transform } from 'stream';
2
2
  import util from 'util';
3
+ import timers from 'timers/promises';
3
4
  import { t } from './i18n/instance.js';
4
5
  import './prototype.js';
5
6
  export const noop = () => { };
@@ -194,10 +195,8 @@ export class Timer {
194
195
  export function log_line() {
195
196
  console.log('---');
196
197
  }
197
- export async function delay(milliseconds) {
198
- return new Promise(resolve => {
199
- setTimeout(resolve, milliseconds);
200
- });
198
+ export async function delay(milliseconds, options) {
199
+ return timers.setTimeout(milliseconds, undefined, options);
201
200
  }
202
201
  export class TimeoutError extends Error {
203
202
  constructor(message, options) {