xshell 1.2.62 → 1.2.64
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/file.js +11 -4
- package/net.d.ts +4 -2
- package/net.js +2 -0
- package/package.json +7 -6
- package/path.d.ts +2 -2
- package/utils.common.d.ts +2 -2
package/file.js
CHANGED
|
@@ -861,7 +861,7 @@ export async function fsync(fp_src, fp_dst, { print = print_files, delete: _dele
|
|
|
861
861
|
fpd_changeds.push(fp);
|
|
862
862
|
if (print.files)
|
|
863
863
|
log_action(`同步${modify ? '修改' : '新增'}`, `${fp_src}${fp}`, `${fp_dst}${fp}`);
|
|
864
|
-
tasks.push(fcopy
|
|
864
|
+
tasks.push(['fcopy', `${fp_src}${fp}`, `${fp_dst}${fp}`]);
|
|
865
865
|
};
|
|
866
866
|
const sync_delete = ({ fp }) => {
|
|
867
867
|
if (fpd_deleteds.some(fpd_deleted => fp.startsWith(fpd_deleted)))
|
|
@@ -870,7 +870,7 @@ export async function fsync(fp_src, fp_dst, { print = print_files, delete: _dele
|
|
|
870
870
|
fpd_deleteds.push(fp);
|
|
871
871
|
if (print.files)
|
|
872
872
|
console.log('同步删除', `${fp_dst}${fp}`);
|
|
873
|
-
tasks.push(fdelete
|
|
873
|
+
tasks.push(['fdelete', `${fp_dst}${fp}`]);
|
|
874
874
|
};
|
|
875
875
|
for (; p < src_stats.length && q < dst_stats.length;) {
|
|
876
876
|
const src = src_stats[p];
|
|
@@ -896,7 +896,13 @@ export async function fsync(fp_src, fp_dst, { print = print_files, delete: _dele
|
|
|
896
896
|
if (_delete)
|
|
897
897
|
for (; q < dst_stats.length; ++q)
|
|
898
898
|
sync_delete(dst_stats[q]);
|
|
899
|
-
await
|
|
899
|
+
const { default: pmap } = await import('p-map');
|
|
900
|
+
await pmap(tasks, async ([task, arg0, arg1]) => {
|
|
901
|
+
if (task === 'fcopy')
|
|
902
|
+
await fcopy(arg0, arg1, noprint);
|
|
903
|
+
else
|
|
904
|
+
await fdelete(arg0, noprint);
|
|
905
|
+
}, { concurrency: 2 });
|
|
900
906
|
}
|
|
901
907
|
else {
|
|
902
908
|
let same = true;
|
|
@@ -929,7 +935,8 @@ export function fp_sorter(l, r) {
|
|
|
929
935
|
}
|
|
930
936
|
/** 返回修改时间与大小是否相同 */
|
|
931
937
|
function compare_stat(src, dst) {
|
|
932
|
-
|
|
938
|
+
// exfat 时间精度为 2s
|
|
939
|
+
return src.size === dst.size && Math.abs(Number(src.mtimeMs) - Number(dst.mtimeMs)) <= 2000;
|
|
933
940
|
}
|
|
934
941
|
export function log_action(action, fp_src, fp_dst, sep = '->') {
|
|
935
942
|
console.log(`${`${action} ${fp_src}`.pad(url_width)} ${sep} ${fp_dst}`);
|
package/net.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export declare const websocket_states: readonly ["connecting", "open", "closing"
|
|
|
15
15
|
export declare enum MyProxy {
|
|
16
16
|
socks5 = "http://127.0.0.1:10080",
|
|
17
17
|
whistle = "http://localhost:8899",
|
|
18
|
-
work = "http://localhost:10090"
|
|
18
|
+
work = "http://localhost:10090",
|
|
19
|
+
/** 需要先启动 server.start_tunnel_server('ddb.test.proxy') */
|
|
20
|
+
test = "http://localhost:10091"
|
|
19
21
|
}
|
|
20
22
|
export declare const byproxy: {
|
|
21
23
|
readonly proxy: true;
|
|
@@ -276,5 +278,5 @@ export declare class RemoteClient {
|
|
|
276
278
|
[inspect.custom](): {
|
|
277
279
|
remote: string;
|
|
278
280
|
websocket: string;
|
|
279
|
-
} & Omit<this, typeof import("util").inspect.custom | "
|
|
281
|
+
} & Omit<this, "call" | typeof import("util").inspect.custom | "websocket" | "remote" | "send">;
|
|
280
282
|
}
|
package/net.js
CHANGED
|
@@ -17,6 +17,8 @@ export var MyProxy;
|
|
|
17
17
|
MyProxy["socks5"] = "http://127.0.0.1:10080";
|
|
18
18
|
MyProxy["whistle"] = "http://localhost:8899";
|
|
19
19
|
MyProxy["work"] = "http://localhost:10090";
|
|
20
|
+
/** 需要先启动 server.start_tunnel_server('ddb.test.proxy') */
|
|
21
|
+
MyProxy["test"] = "http://localhost:10091";
|
|
20
22
|
})(MyProxy || (MyProxy = {}));
|
|
21
23
|
export const byproxy = { proxy: true };
|
|
22
24
|
// ------------------------------------ fetch, request
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@babel/parser": "^7.28.0",
|
|
54
54
|
"@babel/traverse": "^7.28.0",
|
|
55
55
|
"@koa/cors": "^5.0.0",
|
|
56
|
-
"@stylistic/eslint-plugin": "^5.2.
|
|
56
|
+
"@stylistic/eslint-plugin": "^5.2.2",
|
|
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.38.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
62
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
63
63
|
"archiver": "^7.0.1",
|
|
64
64
|
"chalk": "^5.4.1",
|
|
65
65
|
"commander": "^14.0.0",
|
|
@@ -76,8 +76,9 @@
|
|
|
76
76
|
"license-webpack-plugin": "^4.0.2",
|
|
77
77
|
"map-stream": "^0.0.7",
|
|
78
78
|
"mime-types": "^3.0.1",
|
|
79
|
+
"p-map": "^7.0.3",
|
|
79
80
|
"react": "^19.1.0",
|
|
80
|
-
"react-i18next": "^15.6.
|
|
81
|
+
"react-i18next": "^15.6.1",
|
|
81
82
|
"resolve-path": "^1.4.0",
|
|
82
83
|
"sass": "^1.89.2",
|
|
83
84
|
"sass-loader": "^16.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/utils.common.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare function filter_keys<TObj>(obj: TObj, filter: (key: string) => an
|
|
|
46
46
|
- filter?: `not_empty` */
|
|
47
47
|
export declare function filter_values<TObj extends Record<string, any>>(obj: TObj, filter?: (value: TObj[string]) => any): TObj;
|
|
48
48
|
/** 简单选择对象中的部分 keys, 返回新对象 */
|
|
49
|
-
export declare function pick<TObject>(obj: TObject, keys:
|
|
49
|
+
export declare function pick<TObject = any>(obj: TObject, keys: (keyof TObject)[]): Partial<TObject>;
|
|
50
50
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
51
51
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
|
|
52
52
|
/** 模糊过滤字符串列表或对象列表,常用于根据用户输入补全或搜索过滤
|
|
@@ -141,4 +141,4 @@ export declare function ceil2(n: number): number;
|
|
|
141
141
|
export declare function throttle(duration: number, func: Function, delay_first?: boolean): (this: any, ...args: any[]) => void;
|
|
142
142
|
/** 防抖,间隔一段时间不再触发时调用 */
|
|
143
143
|
export declare function debounce(duration: number, func: Function): (this: any, ...args: any[]) => void;
|
|
144
|
-
export declare function tomorrow(date?: Date | string): Date;
|
|
144
|
+
export declare function tomorrow(date?: Date | string | number): Date;
|