xshell 1.2.48 → 1.2.49
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 +12 -12
- package/prototype.browser.d.ts +1 -1
- package/prototype.browser.js +5 -5
- package/prototype.d.ts +1 -1
- package/prototype.js +5 -5
- package/utils.browser.js +3 -3
- package/utils.js +3 -3
- package/xlint.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"@babel/parser": "^7.27.5",
|
|
54
54
|
"@babel/traverse": "^7.27.4",
|
|
55
55
|
"@koa/cors": "^5.0.0",
|
|
56
|
-
"@stylistic/eslint-plugin": "^
|
|
56
|
+
"@stylistic/eslint-plugin": "^5.0.0",
|
|
57
57
|
"@svgr/webpack": "^8.1.0",
|
|
58
58
|
"@types/sass-loader": "^8.0.9",
|
|
59
59
|
"@types/ws": "^8.18.1",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
61
|
-
"@typescript-eslint/parser": "^8.
|
|
62
|
-
"@typescript-eslint/utils": "^8.
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
62
|
+
"@typescript-eslint/utils": "^8.35.0",
|
|
63
63
|
"archiver": "^7.0.1",
|
|
64
64
|
"chalk": "^5.4.1",
|
|
65
65
|
"commander": "^14.0.0",
|
|
66
66
|
"css-loader": "^7.1.2",
|
|
67
67
|
"emoji-regex": "^10.4.0",
|
|
68
|
-
"eslint": "^9.
|
|
69
|
-
"eslint-plugin-import": "^2.
|
|
68
|
+
"eslint": "^9.29.0",
|
|
69
|
+
"eslint-plugin-import": "^2.32.0",
|
|
70
70
|
"eslint-plugin-react": "^7.37.5",
|
|
71
71
|
"https-proxy-agent": "^7.0.6",
|
|
72
72
|
"i18next": "^25.2.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"map-stream": "^0.0.7",
|
|
78
78
|
"mime-types": "^3.0.1",
|
|
79
79
|
"react": "^19.1.0",
|
|
80
|
-
"react-i18next": "^15.5.
|
|
80
|
+
"react-i18next": "^15.5.3",
|
|
81
81
|
"react-object-model": "^1.2.24",
|
|
82
82
|
"resolve-path": "^1.4.0",
|
|
83
83
|
"sass": "^1.89.2",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"ts-loader": "^9.5.2",
|
|
90
90
|
"tslib": "^2.8.1",
|
|
91
91
|
"typescript": "^5.8.3",
|
|
92
|
-
"ua-parser-js": "^2.0.
|
|
92
|
+
"ua-parser-js": "^2.0.4",
|
|
93
93
|
"undici": "^7.10.0",
|
|
94
94
|
"webpack": "^5.99.9",
|
|
95
95
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"@types/koa": "^2.15.0",
|
|
105
105
|
"@types/koa-compress": "^4.0.6",
|
|
106
106
|
"@types/mime-types": "^3.0.1",
|
|
107
|
-
"@types/node": "^24.0.
|
|
108
|
-
"@types/react": "^19.1.
|
|
107
|
+
"@types/node": "^24.0.4",
|
|
108
|
+
"@types/react": "^19.1.8",
|
|
109
109
|
"@types/tough-cookie": "^4.0.5",
|
|
110
110
|
"@types/ua-parser-js": "^0.7.39",
|
|
111
|
-
"@types/vscode": "^1.
|
|
111
|
+
"@types/vscode": "^1.101.0",
|
|
112
112
|
"@types/webpack-bundle-analyzer": "^4.7.0"
|
|
113
113
|
}
|
|
114
114
|
}
|
package/prototype.browser.d.ts
CHANGED
|
@@ -216,7 +216,7 @@ interface SliceOptions {
|
|
|
216
216
|
export declare const emoji_regex: RegExp;
|
|
217
217
|
export declare const noop: () => void;
|
|
218
218
|
export declare const ident: <T>(x: T) => T;
|
|
219
|
-
export declare const
|
|
219
|
+
export declare const select: <TObj = any, TKey extends keyof TObj = keyof TObj>(key: TKey) => (obj: TObj) => TObj[TKey];
|
|
220
220
|
export type Mapper<TObj = any, TKey extends keyof TObj = keyof TObj> = (obj: TObj) => TObj[TKey];
|
|
221
221
|
/** value 不为 null 或 undefined */
|
|
222
222
|
export declare const not_empty: (value: any) => boolean;
|
package/prototype.browser.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t } from "./i18n/instance.js";
|
|
|
4
4
|
export const emoji_regex = EmojiRegex();
|
|
5
5
|
export const noop = () => { };
|
|
6
6
|
export const ident = (x) => x;
|
|
7
|
-
export const
|
|
7
|
+
export const select = (key) => (obj) => obj[key];
|
|
8
8
|
/** value 不为 null 或 undefined */
|
|
9
9
|
export const not_empty = (value) => value !== null && value !== undefined;
|
|
10
10
|
export const empty = (value) => value === undefined || value === null;
|
|
@@ -509,7 +509,7 @@ Object.defineProperties(Array.prototype, {
|
|
|
509
509
|
if ((typeof first === 'number' || typeof first === 'bigint') && !mapper)
|
|
510
510
|
return this.reduce((acc, x) => acc + x, zero);
|
|
511
511
|
if (is_key_type(mapper))
|
|
512
|
-
mapper =
|
|
512
|
+
mapper = select(mapper);
|
|
513
513
|
mapper ??= ident;
|
|
514
514
|
return this.reduce((acc, x) => acc + mapper(x), zero);
|
|
515
515
|
},
|
|
@@ -517,7 +517,7 @@ Object.defineProperties(Array.prototype, {
|
|
|
517
517
|
if (!this.length)
|
|
518
518
|
return undefined;
|
|
519
519
|
if (is_key_type(mapper))
|
|
520
|
-
mapper =
|
|
520
|
+
mapper = select(mapper);
|
|
521
521
|
let max = mapper(this[0]);
|
|
522
522
|
let imax = 0;
|
|
523
523
|
for (let i = 0; i < this.length; i++) {
|
|
@@ -533,7 +533,7 @@ Object.defineProperties(Array.prototype, {
|
|
|
533
533
|
if (!this.length)
|
|
534
534
|
return undefined;
|
|
535
535
|
if (is_key_type(mapper))
|
|
536
|
-
mapper =
|
|
536
|
+
mapper = select(mapper);
|
|
537
537
|
let min = mapper(this[0]);
|
|
538
538
|
let imin = 0;
|
|
539
539
|
for (let i = 0; i < this.length; i++) {
|
|
@@ -549,7 +549,7 @@ Object.defineProperties(Array.prototype, {
|
|
|
549
549
|
if (!mapper)
|
|
550
550
|
return [...new Set(this)];
|
|
551
551
|
if (is_key_type(mapper))
|
|
552
|
-
mapper =
|
|
552
|
+
mapper = select(mapper);
|
|
553
553
|
let map = new Map();
|
|
554
554
|
for (const x of this)
|
|
555
555
|
map.set(mapper(x), x);
|
package/prototype.d.ts
CHANGED
|
@@ -246,7 +246,7 @@ interface SliceOptions {
|
|
|
246
246
|
export declare const emoji_regex: RegExp;
|
|
247
247
|
export declare const noop: () => void;
|
|
248
248
|
export declare const ident: <T>(x: T) => T;
|
|
249
|
-
export declare const
|
|
249
|
+
export declare const select: <TObj = any, TKey extends keyof TObj = keyof TObj>(key: TKey) => (obj: TObj) => TObj[TKey];
|
|
250
250
|
export type Mapper<TObj = any, TKey extends keyof TObj = keyof TObj> = (obj: TObj) => TObj[TKey];
|
|
251
251
|
/** value 不为 null 或 undefined */
|
|
252
252
|
export declare const not_empty: (value: any) => boolean;
|
package/prototype.js
CHANGED
|
@@ -5,7 +5,7 @@ import strip_ansi from 'strip-ansi';
|
|
|
5
5
|
import { t } from "./i18n/instance.js";
|
|
6
6
|
export const noop = () => { };
|
|
7
7
|
export const ident = (x) => x;
|
|
8
|
-
export const
|
|
8
|
+
export const select = (key) => (obj) => obj[key];
|
|
9
9
|
/** value 不为 null 或 undefined */
|
|
10
10
|
export const not_empty = (value) => value !== null && value !== undefined;
|
|
11
11
|
export const empty = (value) => value === undefined || value === null;
|
|
@@ -582,7 +582,7 @@ if (!globalThis.my_prototype_defined) {
|
|
|
582
582
|
if ((typeof first === 'number' || typeof first === 'bigint') && !mapper)
|
|
583
583
|
return this.reduce((acc, x) => acc + x, zero);
|
|
584
584
|
if (is_key_type(mapper))
|
|
585
|
-
mapper =
|
|
585
|
+
mapper = select(mapper);
|
|
586
586
|
mapper ??= ident;
|
|
587
587
|
return this.reduce((acc, x) => acc + mapper(x), zero);
|
|
588
588
|
},
|
|
@@ -590,7 +590,7 @@ if (!globalThis.my_prototype_defined) {
|
|
|
590
590
|
if (!this.length)
|
|
591
591
|
return undefined;
|
|
592
592
|
if (is_key_type(mapper))
|
|
593
|
-
mapper =
|
|
593
|
+
mapper = select(mapper);
|
|
594
594
|
let max = mapper(this[0]);
|
|
595
595
|
let imax = 0;
|
|
596
596
|
for (let i = 0; i < this.length; i++) {
|
|
@@ -606,7 +606,7 @@ if (!globalThis.my_prototype_defined) {
|
|
|
606
606
|
if (!this.length)
|
|
607
607
|
return undefined;
|
|
608
608
|
if (is_key_type(mapper))
|
|
609
|
-
mapper =
|
|
609
|
+
mapper = select(mapper);
|
|
610
610
|
let min = mapper(this[0]);
|
|
611
611
|
let imin = 0;
|
|
612
612
|
for (let i = 0; i < this.length; i++) {
|
|
@@ -622,7 +622,7 @@ if (!globalThis.my_prototype_defined) {
|
|
|
622
622
|
if (!mapper)
|
|
623
623
|
return [...new Set(this)];
|
|
624
624
|
if (is_key_type(mapper))
|
|
625
|
-
mapper =
|
|
625
|
+
mapper = select(mapper);
|
|
626
626
|
let map = new Map();
|
|
627
627
|
for (const x of this)
|
|
628
628
|
map.set(mapper(x), x);
|
package/utils.browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { is_key_type,
|
|
1
|
+
import { is_key_type, select, not_empty, ident } from "./prototype.browser.js";
|
|
2
2
|
import { t } from "./i18n/instance.js";
|
|
3
3
|
export function assert(assertion, message) {
|
|
4
4
|
if (!assertion) {
|
|
@@ -33,7 +33,7 @@ export function unique(iterable, mapper) {
|
|
|
33
33
|
if (!mapper)
|
|
34
34
|
return [...new Set(iterable)];
|
|
35
35
|
if (is_key_type(mapper))
|
|
36
|
-
mapper =
|
|
36
|
+
mapper = select(mapper);
|
|
37
37
|
let map = new Map();
|
|
38
38
|
for (const x of iterable)
|
|
39
39
|
map.set(mapper(x), x);
|
|
@@ -282,7 +282,7 @@ export function fuzzyfilter(query, list, mapper = ident, list_lower, single_char
|
|
|
282
282
|
if (!query)
|
|
283
283
|
return list;
|
|
284
284
|
if (is_key_type(mapper))
|
|
285
|
-
mapper =
|
|
285
|
+
mapper = select(mapper);
|
|
286
286
|
mapper ??= ident;
|
|
287
287
|
list_lower ??= list.map(item => mapper(item).toLowerCase());
|
|
288
288
|
const query_lower = query.toLowerCase();
|
package/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Stream, Writable, Transform } from 'stream';
|
|
|
2
2
|
import util from 'util';
|
|
3
3
|
import timers from 'timers/promises';
|
|
4
4
|
import { t } from "./i18n/instance.js";
|
|
5
|
-
import {
|
|
5
|
+
import { select, not_empty, is_key_type, noop, ident } from "./prototype.js";
|
|
6
6
|
/** `180` 输出字符宽度 */
|
|
7
7
|
export const output_width = 180;
|
|
8
8
|
export const url_width = 52;
|
|
@@ -55,7 +55,7 @@ export function unique(iterable, mapper) {
|
|
|
55
55
|
if (!mapper)
|
|
56
56
|
return [...new Set(iterable)];
|
|
57
57
|
if (is_key_type(mapper))
|
|
58
|
-
mapper =
|
|
58
|
+
mapper = select(mapper);
|
|
59
59
|
let map = new Map();
|
|
60
60
|
for (const x of iterable)
|
|
61
61
|
map.set(mapper(x), x);
|
|
@@ -152,7 +152,7 @@ export function fuzzyfilter(query, list, mapper = ident, list_lower, single_char
|
|
|
152
152
|
if (!query)
|
|
153
153
|
return list;
|
|
154
154
|
if (is_key_type(mapper))
|
|
155
|
-
mapper =
|
|
155
|
+
mapper = select(mapper);
|
|
156
156
|
mapper ??= ident;
|
|
157
157
|
list_lower ??= list.map(item => mapper(item).toLowerCase());
|
|
158
158
|
const query_lower = query.toLowerCase();
|
package/xlint.js
CHANGED
|
@@ -809,7 +809,7 @@ export const xlint_config = {
|
|
|
809
809
|
// [a, b, c]
|
|
810
810
|
'@stylistic/comma-spacing': 'error',
|
|
811
811
|
// foo()
|
|
812
|
-
'@stylistic/
|
|
812
|
+
'@stylistic/function-call-spacing': 'error',
|
|
813
813
|
// a => { } 中箭头左右两边空格
|
|
814
814
|
'@stylistic/arrow-spacing': ['error'],
|
|
815
815
|
// 注释双斜杠后面要有空格
|