xshell 1.0.84 → 1.0.85

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.js CHANGED
@@ -80,7 +80,7 @@ export async function request(url, options = {}) {
80
80
  let headers = {
81
81
  'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5',
82
82
  'accept-encoding': 'gzip, deflate, br',
83
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
83
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
84
84
  'sec-ch-ua-platform': '"Windows"',
85
85
  'sec-ch-ua-platform-version': '"15.0.0"',
86
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.84",
3
+ "version": "1.0.85",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -53,17 +53,17 @@
53
53
  ]
54
54
  },
55
55
  "dependencies": {
56
- "@babel/core": "^7.24.0",
57
- "@babel/parser": "^7.24.0",
58
- "@babel/traverse": "^7.24.0",
56
+ "@babel/core": "^7.24.3",
57
+ "@babel/parser": "^7.24.1",
58
+ "@babel/traverse": "^7.24.1",
59
59
  "@koa/cors": "^5.0.0",
60
60
  "@types/ws": "^8.5.10",
61
61
  "ali-oss": "^6.20.0",
62
- "archiver": "^7.0.0",
62
+ "archiver": "^7.0.1",
63
63
  "byte-size": "^8.1.1",
64
64
  "chalk": "^5.3.0",
65
65
  "chardet": "^2.0.0",
66
- "cli-table3": "^0.6.3",
66
+ "cli-table3": "^0.6.4",
67
67
  "cli-truncate": "^4.0.0",
68
68
  "colors": "^1.4.0",
69
69
  "commander": "^12.0.0",
@@ -73,7 +73,7 @@
73
73
  "i18next": "^23.10.1",
74
74
  "i18next-scanner": "^4.4.0",
75
75
  "js-cookie": "^3.0.5",
76
- "koa": "^2.15.0",
76
+ "koa": "^2.15.2",
77
77
  "koa-compress": "^5.1.1",
78
78
  "lodash": "^4.17.21",
79
79
  "map-stream": "0.0.7",
@@ -81,15 +81,15 @@
81
81
  "ora": "^8.0.1",
82
82
  "react": "^18.2.0",
83
83
  "react-i18next": "^14.1.0",
84
- "react-object-model": "^1.2.2",
84
+ "react-object-model": "^1.2.3",
85
85
  "resolve-path": "^1.4.0",
86
86
  "strip-ansi": "^7.1.0",
87
87
  "through2": "^4.0.2",
88
88
  "tough-cookie": "^4.1.3",
89
89
  "tslib": "^2.6.2",
90
- "typescript": "^5.4.2",
90
+ "typescript": "^5.4.3",
91
91
  "ua-parser-js": "2.0.0-alpha.2",
92
- "undici": "^6.7.0",
92
+ "undici": "^6.10.1",
93
93
  "vinyl": "^3.0.0",
94
94
  "vinyl-fs": "^4.0.0",
95
95
  "ws": "^8.16.0",
@@ -109,10 +109,10 @@
109
109
  "@types/js-cookie": "^3.0.6",
110
110
  "@types/koa": "^2.15.0",
111
111
  "@types/koa-compress": "^4.0.6",
112
- "@types/lodash": "^4.14.202",
112
+ "@types/lodash": "^4.17.0",
113
113
  "@types/mime-types": "^2.1.4",
114
- "@types/node": "^20.11.25",
115
- "@types/react": "^18.2.64",
114
+ "@types/node": "^20.11.30",
115
+ "@types/react": "^18.2.70",
116
116
  "@types/through2": "^2.0.41",
117
117
  "@types/tough-cookie": "^4.0.5",
118
118
  "@types/ua-parser-js": "^0.7.39",
@@ -122,7 +122,7 @@
122
122
  "pnpm": {
123
123
  "patchedDependencies": {
124
124
  "@types/byte-size@8.1.2": "patches/@types__byte-size@8.1.2.patch",
125
- "koa@2.15.0": "patches/koa@2.15.0.patch"
125
+ "koa@2.15.2": "patches/koa@2.15.2.patch"
126
126
  }
127
127
  }
128
128
  }
package/process.d.ts CHANGED
@@ -48,8 +48,7 @@ interface StartOptions {
48
48
  - encoding?: `'utf-8'` 子进程输出编码 child output encoding
49
49
  - print?: `true` print 选项,支持设置细项 print option (with details)
50
50
  - stdio?: `'pipe'` 设置为 'ignore' 时忽略 stdio 处理 when 'ignore' then ignore stdio processing
51
- - detached?: `false` 是否断开和 child 的关系 (ignore stdio, unref) whether to break the connection with child (ignore stdio, unref)
52
- */
51
+ - detached?: `false` 是否断开和 child 的关系 (ignore stdio, unref) whether to break the connection with child (ignore stdio, unref) */
53
52
  export declare function start(exe: string, args?: string[], { cwd, encoding, print, stdio, detached, envs, window: _window, }?: StartOptions): Promise<ChildProcess>;
54
53
  export declare function start_nodejs(js: string, args?: string[], options?: StartOptions): Promise<ChildProcess>;
55
54
  export interface CallOptions extends StartOptions {
package/process.js CHANGED
@@ -15,8 +15,7 @@ export const username = os.userInfo().username;
15
15
  - encoding?: `'utf-8'` 子进程输出编码 child output encoding
16
16
  - print?: `true` print 选项,支持设置细项 print option (with details)
17
17
  - stdio?: `'pipe'` 设置为 'ignore' 时忽略 stdio 处理 when 'ignore' then ignore stdio processing
18
- - detached?: `false` 是否断开和 child 的关系 (ignore stdio, unref) whether to break the connection with child (ignore stdio, unref)
19
- */
18
+ - detached?: `false` 是否断开和 child 的关系 (ignore stdio, unref) whether to break the connection with child (ignore stdio, unref) */
20
19
  export async function start(exe, args = [], { cwd, encoding = 'utf-8', print = true, stdio = 'pipe', detached = false, envs, window: _window = true, } = {}) {
21
20
  const options = {
22
21
  cwd,
@@ -75,6 +75,10 @@ declare global {
75
75
  text: string;
76
76
  };
77
77
  space(this: string): string;
78
+ /** assert 确保字符串以 prefix 开头(失败时抛出错误),并返回去掉该 prefix 的字符串 */
79
+ strip_start(this: string, prefix: string): string;
80
+ /** assert 确保字符串以 suffix 结尾(失败时抛出错误),并返回去掉该 suffix 的字符串 */
81
+ strip_end(this: string, suffix: string): string;
78
82
  /** 等价于 .endsWith('/') */
79
83
  isdir: boolean;
80
84
  /** 以 `/` 分割的路径,可能以 / 结尾 */
@@ -259,6 +259,18 @@ Object.defineProperties(String.prototype, {
259
259
  text: this.slice(i)
260
260
  };
261
261
  },
262
+ strip_start(prefix) {
263
+ if (this.startsWith(prefix))
264
+ return this.slice(prefix.length);
265
+ else
266
+ throw new Error(`字符串没有以前缀 ${prefix} 开头: ${this}`);
267
+ },
268
+ strip_end(suffix) {
269
+ if (this.endsWith(suffix))
270
+ return this.slice(0, -suffix.length);
271
+ else
272
+ throw new Error(`字符串没有以后缀 ${suffix} 结尾: ${this}`);
273
+ },
262
274
  space() {
263
275
  if (!this)
264
276
  return this;
package/prototype.d.ts CHANGED
@@ -98,6 +98,10 @@ declare global {
98
98
  decode_base64(this: string, buffer: true): Buffer;
99
99
  decode_base64(this: string, buffer?: boolean): string | Buffer;
100
100
  space(this: string): string;
101
+ /** assert 确保字符串以 prefix 开头(失败时抛出错误),并返回去掉该 prefix 的字符串 */
102
+ strip_start(this: string, prefix: string): string;
103
+ /** assert 确保字符串以 suffix 结尾(失败时抛出错误),并返回去掉该 suffix 的字符串 */
104
+ strip_end(this: string, suffix: string): string;
101
105
  /** 等价于 .endsWith('/') */
102
106
  isdir: boolean;
103
107
  /** 以 `/` 分割的路径,可能以 / 结尾 */
package/prototype.js CHANGED
@@ -278,6 +278,18 @@ if (!globalThis.my_prototype_defined) {
278
278
  strip_ansi() {
279
279
  return strip_ansi(this);
280
280
  },
281
+ strip_start(prefix) {
282
+ if (this.startsWith(prefix))
283
+ return this.slice(prefix.length);
284
+ else
285
+ throw new Error(`字符串没有以前缀 ${prefix} 开头: ${this}`);
286
+ },
287
+ strip_end(suffix) {
288
+ if (this.endsWith(suffix))
289
+ return this.slice(0, -suffix.length);
290
+ else
291
+ throw new Error(`字符串没有以后缀 ${suffix} 结尾: ${this}`);
292
+ },
281
293
  space() {
282
294
  if (!this)
283
295
  return this;
File without changes