xshell 1.2.63 → 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 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(`${fp_src}${fp}`, `${fp_dst}${fp}`, noprint));
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(`${fp_dst}${fp}`, noprint));
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 Promise.all(tasks);
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
- return src.size === dst.size && Math.abs(Number(src.mtimeMs) - Number(dst.mtimeMs)) <= 1;
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 | "call" | "websocket" | "remote" | "send">;
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.63",
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.0",
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.37.0",
61
- "@typescript-eslint/parser": "^8.37.0",
62
- "@typescript-eslint/utils": "^8.37.0",
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.0",
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
@@ -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;