xshell 1.0.88 → 1.0.89

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.d.ts CHANGED
@@ -52,7 +52,9 @@ export declare function fread_json<T = any>(fp: string, options?: {
52
52
  print?: boolean;
53
53
  }): Promise<T>;
54
54
  /** 比较两个文件是否一致,遇到任何文件系统错误都返回 false */
55
- export declare function fequals(fp_left: string, fp_right: string): Promise<boolean>;
55
+ export declare function fequals(fp_left: string, fp_right: string, { print }?: {
56
+ print?: boolean;
57
+ }): Promise<boolean>;
56
58
  interface FWriteOptions {
57
59
  print?: boolean;
58
60
  }
package/file.js CHANGED
@@ -56,12 +56,14 @@ export async function fread_json(fp, options = {}) {
56
56
  return JSON.parse(await fread(fp, options));
57
57
  }
58
58
  /** 比较两个文件是否一致,遇到任何文件系统错误都返回 false */
59
- export async function fequals(fp_left, fp_right) {
59
+ export async function fequals(fp_left, fp_right, { print = true } = {}) {
60
+ if (print)
61
+ console.log(`比较 ${fp_left} 和 ${fp_right}`);
60
62
  try {
61
63
  const fps = [fp_left, fp_right];
62
64
  const [{ size: size_left }, { size: size_right }] = await Promise.all(fps.map(async (fp) => fstat(fp)));
63
65
  if (size_left === size_right) {
64
- const [data_left, data_right] = await Promise.all(fps.map(async (fp) => fread(fp, { encoding: 'binary' })));
66
+ const [data_left, data_right] = await Promise.all(fps.map(async (fp) => fread(fp, { encoding: 'binary', print: false })));
65
67
  return data_left.equals(data_right);
66
68
  }
67
69
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -58,9 +58,9 @@
58
58
  "@babel/traverse": "^7.24.1",
59
59
  "@koa/cors": "^5.0.0",
60
60
  "@types/ws": "^8.5.10",
61
- "@typescript-eslint/eslint-plugin": "^7.5.0",
62
- "@typescript-eslint/parser": "^7.5.0",
63
- "@typescript-eslint/utils": "^7.5.0",
61
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
62
+ "@typescript-eslint/parser": "^7.6.0",
63
+ "@typescript-eslint/utils": "^7.6.0",
64
64
  "ali-oss": "^6.20.0",
65
65
  "archiver": "^7.0.1",
66
66
  "byte-size": "^8.1.1",
@@ -76,7 +76,7 @@
76
76
  "eslint-plugin-react": "^7.34.1",
77
77
  "gulp-sort": "^2.0.0",
78
78
  "hash-string": "^1.0.0",
79
- "i18next": "^23.10.1",
79
+ "i18next": "^23.11.0",
80
80
  "i18next-scanner": "^4.4.0",
81
81
  "js-cookie": "^3.0.5",
82
82
  "koa": "^2.15.2",
@@ -95,7 +95,7 @@
95
95
  "tslib": "^2.6.2",
96
96
  "typescript": "^5.4.4",
97
97
  "ua-parser-js": "2.0.0-alpha.2",
98
- "undici": "^6.11.1",
98
+ "undici": "^6.12.0",
99
99
  "vinyl": "^3.0.0",
100
100
  "vinyl-fs": "^4.0.0",
101
101
  "ws": "^8.16.0",
@@ -120,7 +120,7 @@
120
120
  "@types/lodash": "^4.17.0",
121
121
  "@types/mime-types": "^2.1.4",
122
122
  "@types/node": "^20.12.5",
123
- "@types/react": "^18.2.74",
123
+ "@types/react": "^18.2.75",
124
124
  "@types/through2": "^2.0.41",
125
125
  "@types/tough-cookie": "^4.0.5",
126
126
  "@types/ua-parser-js": "^0.7.39",
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;
@@ -56,7 +56,7 @@ export declare function encode(str: string): Uint8Array;
56
56
  在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
57
57
  export declare function decode(buffer: Uint8Array): string;
58
58
  /** 字符串字典序比较 */
59
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
59
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
60
60
  /** 比较 1.10.02 这种版本号 */
61
61
  export declare function vercmp(l: string, r: string): number;
62
62
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
package/utils.d.ts CHANGED
@@ -34,7 +34,7 @@ export declare function filter_keys<TObj>(obj: TObj, filter: (key: string) => an
34
34
  /** 忽略对象中的 keys, 返回新对象 */
35
35
  export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
36
36
  /** 字符串字典序比较 */
37
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
37
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
38
38
  /** 比较 1.10.02 这种版本号 */
39
39
  export declare function vercmp(l: string, r: string): number;
40
40
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;