xshell 1.1.7 → 1.1.8

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.
Files changed (3) hide show
  1. package/package.json +8 -8
  2. package/storage.d.ts +12 -0
  3. package/storage.js +28 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -57,9 +57,9 @@
57
57
  "@svgr/webpack": "^8.1.0",
58
58
  "@types/sass-loader": "^8.0.9",
59
59
  "@types/ws": "^8.5.13",
60
- "@typescript-eslint/eslint-plugin": "^8.18.0",
61
- "@typescript-eslint/parser": "^8.18.0",
62
- "@typescript-eslint/utils": "^8.18.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.18.1",
61
+ "@typescript-eslint/parser": "^8.18.1",
62
+ "@typescript-eslint/utils": "^8.18.1",
63
63
  "@xterm/addon-fit": "^0.10.0",
64
64
  "@xterm/addon-web-links": "^0.11.0",
65
65
  "@xterm/addon-webgl": "^0.18.0",
@@ -67,7 +67,7 @@
67
67
  "ali-oss": "^6.22.0",
68
68
  "archiver": "^7.0.1",
69
69
  "byte-size": "^9.0.1",
70
- "chalk": "^5.3.0",
70
+ "chalk": "^5.4.0",
71
71
  "chardet": "^2.0.0",
72
72
  "cli-table3": "^0.6.5",
73
73
  "cli-truncate": "^4.0.0",
@@ -81,7 +81,7 @@
81
81
  "gulp-sort": "^2.0.0",
82
82
  "hash-string": "^1.0.0",
83
83
  "https-proxy-agent": "^7.0.6",
84
- "i18next": "^24.1.0",
84
+ "i18next": "^24.1.2",
85
85
  "i18next-scanner": "^4.6.0",
86
86
  "koa": "^2.15.3",
87
87
  "koa-compress": "^5.1.1",
@@ -105,7 +105,7 @@
105
105
  "tslib": "^2.8.1",
106
106
  "typescript": "^5.7.2",
107
107
  "ua-parser-js": "^2.0.0",
108
- "undici": "^7.1.0",
108
+ "undici": "^7.2.0",
109
109
  "vinyl": "^3.0.0",
110
110
  "vinyl-fs": "^4.0.0",
111
111
  "webpack": "^5.97.1",
@@ -127,7 +127,7 @@
127
127
  "@types/lodash": "^4.17.13",
128
128
  "@types/mime-types": "^2.1.4",
129
129
  "@types/node": "^22.10.2",
130
- "@types/react": "^19.0.1",
130
+ "@types/react": "^19.0.2",
131
131
  "@types/through2": "^2.0.41",
132
132
  "@types/tough-cookie": "^4.0.5",
133
133
  "@types/ua-parser-js": "^0.7.39",
package/storage.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export declare let storage: {
2
+ /** 通过 key 获取字符串类型的值,不存在时返回空字符串 ('') */
3
+ getstr(key: string): string;
4
+ /** 将字符串类型的值保存到 key */
5
+ setstr(key: string, value?: string): void;
6
+ /** 根据 key 获取 JSON 类型的值,不存在时返回通过第二个参数传入的默认值,默认为 null */
7
+ get<TValue = any>(key: string, _default?: TValue): TValue;
8
+ /** 保存 JSON 类型的值到 key */
9
+ set(key: string, value: any): void;
10
+ list(): string[];
11
+ delete(key: string): void;
12
+ };
package/storage.js ADDED
@@ -0,0 +1,28 @@
1
+ export let storage = {
2
+ /** 通过 key 获取字符串类型的值,不存在时返回空字符串 ('') */
3
+ getstr(key) {
4
+ return localStorage.getItem(key) || '';
5
+ },
6
+ /** 将字符串类型的值保存到 key */
7
+ setstr(key, value = '') {
8
+ localStorage.setItem(key, value);
9
+ },
10
+ /** 根据 key 获取 JSON 类型的值,不存在时返回通过第二个参数传入的默认值,默认为 null */
11
+ get(key, _default = null) {
12
+ const strvalue = localStorage.getItem(key);
13
+ return strvalue === null
14
+ ? _default
15
+ : JSON.parse(strvalue);
16
+ },
17
+ /** 保存 JSON 类型的值到 key */
18
+ set(key, value) {
19
+ localStorage.setItem(key, JSON.stringify(value));
20
+ },
21
+ list() {
22
+ return Object.keys(localStorage);
23
+ },
24
+ delete(key) {
25
+ localStorage.removeItem(key);
26
+ }
27
+ };
28
+ //# sourceMappingURL=storage.js.map