xshell 1.2.10 → 1.2.12

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/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './utils.ts';
4
4
  export * from './file.ts';
5
5
  export * from './process.ts';
6
6
  export * from './net.ts';
7
+ export { path } from './path.ts';
package/index.js CHANGED
@@ -4,4 +4,5 @@ export * from "./utils.js";
4
4
  export * from "./file.js";
5
5
  export * from "./process.js";
6
6
  export * from "./net.js";
7
+ export { path } from "./path.js";
7
8
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -49,14 +49,14 @@
49
49
  ]
50
50
  },
51
51
  "dependencies": {
52
- "@babel/core": "^7.26.0",
53
- "@babel/parser": "^7.26.5",
54
- "@babel/traverse": "^7.26.5",
52
+ "@babel/core": "^7.26.7",
53
+ "@babel/parser": "^7.26.7",
54
+ "@babel/traverse": "^7.26.7",
55
55
  "@koa/cors": "^5.0.0",
56
- "@stylistic/eslint-plugin": "^2.13.0",
56
+ "@stylistic/eslint-plugin": "^3.0.0",
57
57
  "@svgr/webpack": "^8.1.0",
58
58
  "@types/sass-loader": "^8.0.9",
59
- "@types/ws": "^8.5.13",
59
+ "@types/ws": "^8.5.14",
60
60
  "@typescript-eslint/eslint-plugin": "^8.21.0",
61
61
  "@typescript-eslint/parser": "^8.21.0",
62
62
  "@typescript-eslint/utils": "^8.21.0",
@@ -67,12 +67,12 @@
67
67
  "commander": "^13.1.0",
68
68
  "css-loader": "^7.1.2",
69
69
  "emoji-regex": "^10.4.0",
70
- "eslint": "^9.18.0",
70
+ "eslint": "^9.19.0",
71
71
  "eslint-plugin-import": "^2.31.0",
72
72
  "eslint-plugin-react": "^7.37.4",
73
73
  "gulp-sort": "^2.0.0",
74
74
  "https-proxy-agent": "^7.0.6",
75
- "i18next": "^24.2.1",
75
+ "i18next": "^24.2.2",
76
76
  "i18next-scanner": "^4.6.0",
77
77
  "koa": "^2.15.3",
78
78
  "koa-compress": "^5.1.1",
@@ -96,7 +96,7 @@
96
96
  "tslib": "^2.8.1",
97
97
  "typescript": "^5.7.3",
98
98
  "ua-parser-js": "^2.0.0",
99
- "undici": "^7.2.3",
99
+ "undici": "^7.3.0",
100
100
  "vinyl": "^3.0.0",
101
101
  "vinyl-fs": "^4.0.0",
102
102
  "webpack": "^5.97.1",
@@ -104,7 +104,7 @@
104
104
  "ws": "^8.18.0"
105
105
  },
106
106
  "devDependencies": {
107
- "@babel/types": "^7.26.5",
107
+ "@babel/types": "^7.26.7",
108
108
  "@types/archiver": "^6.0.3",
109
109
  "@types/babel__traverse": "^7.20.6",
110
110
  "@types/eslint": "^9.6.1",
@@ -114,8 +114,8 @@
114
114
  "@types/koa-compress": "^4.0.6",
115
115
  "@types/lodash": "^4.17.14",
116
116
  "@types/mime-types": "^2.1.4",
117
- "@types/node": "^22.10.7",
118
- "@types/react": "^19.0.7",
117
+ "@types/node": "^22.10.10",
118
+ "@types/react": "^19.0.8",
119
119
  "@types/through2": "^2.0.41",
120
120
  "@types/tough-cookie": "^4.0.5",
121
121
  "@types/ua-parser-js": "^0.7.39",
@@ -187,7 +187,7 @@ declare global {
187
187
  rm_empty_lines?: boolean;
188
188
  rm_last_empty_lines?: boolean;
189
189
  }): string[];
190
- /** - append?: `true` 是否在 join 之后增加 \n */
190
+ /** - append?: `this.length` 是否在 join 之后增加 \n */
191
191
  join_lines(append?: boolean): string;
192
192
  }
193
193
  interface BigInt {
@@ -546,7 +546,7 @@ Object.defineProperties(Array.prototype, {
546
546
  map.set(mapper(x), x);
547
547
  return [...map.values()];
548
548
  },
549
- join_lines(append = true) {
549
+ join_lines(append = Boolean(this.length)) {
550
550
  return `${this.join('\n')}${append ? '\n' : ''}`;
551
551
  }
552
552
  })
package/prototype.d.ts CHANGED
@@ -217,7 +217,7 @@ declare global {
217
217
  indent: number;
218
218
  text: string;
219
219
  }[];
220
- /** - append?: `true` 是否在 join 之后增加 \n */
220
+ /** - append?: `this.length` 是否在 join 之后增加 \n */
221
221
  join_lines(append?: boolean): string;
222
222
  }
223
223
  interface BigInt {
package/prototype.js CHANGED
@@ -610,7 +610,7 @@ if (!globalThis.my_prototype_defined) {
610
610
  map.set(mapper(x), x);
611
611
  return [...map.values()];
612
612
  },
613
- join_lines(append = true) {
613
+ join_lines(append = Boolean(this.length)) {
614
614
  return `${this.join('\n')}${append ? '\n' : ''}`;
615
615
  }
616
616
  })
package/storage.d.ts CHANGED
@@ -10,3 +10,13 @@ export declare let storage: {
10
10
  list(): string[];
11
11
  delete(key: string): void;
12
12
  };
13
+ export declare let db: {
14
+ store_name: "kv-store";
15
+ db: IDBDatabase;
16
+ wait_request<TResult>(request: IDBOpenDBRequest | IDBRequest): Promise<TResult>;
17
+ open(): Promise<void>;
18
+ transaction(mode: IDBTransactionMode): IDBObjectStore;
19
+ get<TReturn = any>(key: IDBValidKey): Promise<TReturn>;
20
+ set(key: IDBValidKey, value: any): Promise<void>;
21
+ delete(key: string): Promise<void>;
22
+ };
package/storage.js CHANGED
@@ -26,4 +26,42 @@ export let storage = {
26
26
  localStorage.removeItem(key);
27
27
  }
28
28
  };
29
+ export let db = {
30
+ store_name: 'kv-store',
31
+ db: null,
32
+ async wait_request(request) {
33
+ return new Promise((resolve, reject) => {
34
+ request.onerror = event => {
35
+ reject(request.error);
36
+ };
37
+ request.onsuccess = event => {
38
+ resolve(request.result);
39
+ };
40
+ });
41
+ },
42
+ async open() {
43
+ let request = indexedDB.open('storage');
44
+ request.onupgradeneeded = event => {
45
+ request.result.createObjectStore(this.store_name);
46
+ };
47
+ this.db = await this.wait_request(request);
48
+ },
49
+ transaction(mode) {
50
+ return this.db.transaction(this.store_name, mode)
51
+ .objectStore(this.store_name);
52
+ },
53
+ async get(key) {
54
+ return this.wait_request(this.transaction('readonly').get(key));
55
+ },
56
+ async set(key, value) {
57
+ // 当 uint8array 长度与底层的 arraybuffer 长度不同时,可能是其中的一个 view,为了存储效率直接创建一个独立的 arraybuffer
58
+ if (value && value instanceof Uint8Array && value.byteLength !== value.buffer.byteLength)
59
+ value = value.slice();
60
+ await this.wait_request(this.transaction('readwrite').put(value, key));
61
+ },
62
+ async delete(key) {
63
+ return this.wait_request(this.transaction('readwrite')
64
+ .delete(key));
65
+ }
66
+ };
29
67
  //# sourceMappingURL=storage.js.map