xshell 1.0.130 → 1.0.132
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/git.d.ts +8 -0
- package/git.js +14 -0
- package/package.json +1 -1
- package/path.d.ts +2 -2
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +1 -1
package/git.d.ts
CHANGED
|
@@ -33,4 +33,12 @@ export declare class Git {
|
|
|
33
33
|
checkout(branch?: 'main'): Promise<void>;
|
|
34
34
|
checkout(branch?: string): Promise<void>;
|
|
35
35
|
_checkout(branch?: string): Promise<void>;
|
|
36
|
+
get_version_info(version?: string): Promise<{
|
|
37
|
+
version: string;
|
|
38
|
+
branch: string;
|
|
39
|
+
time: string;
|
|
40
|
+
hash: string;
|
|
41
|
+
commiter: string;
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
36
44
|
}
|
package/git.js
CHANGED
|
@@ -120,5 +120,19 @@ export class Git {
|
|
|
120
120
|
throw error;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
+
async get_version_info(version) {
|
|
124
|
+
const branch = await this.get_branch();
|
|
125
|
+
const { hash, time, commiter, message } = (await this.get_last_commits(1))[0];
|
|
126
|
+
version ||= branch;
|
|
127
|
+
const timestr = time.to_formal_str();
|
|
128
|
+
return {
|
|
129
|
+
version,
|
|
130
|
+
branch,
|
|
131
|
+
time: timestr,
|
|
132
|
+
hash: hash.slice(0, 6),
|
|
133
|
+
commiter,
|
|
134
|
+
message
|
|
135
|
+
};
|
|
136
|
+
}
|
|
123
137
|
}
|
|
124
138
|
//# sourceMappingURL=git.js.map
|
package/package.json
CHANGED
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.browser.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export declare function encode(str: string): Uint8Array;
|
|
|
65
65
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
66
66
|
export declare function decode(buffer: Uint8Array): string;
|
|
67
67
|
/** 字符串字典序比较 */
|
|
68
|
-
export declare function strcmp(l: string, r: string):
|
|
68
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
69
69
|
/** 比较 1.10.02 这种版本号 */
|
|
70
70
|
export declare function vercmp(l: string, r: string): number;
|
|
71
71
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare function filter_values<TObj extends Record<string, any>>(obj: TOb
|
|
|
41
41
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
42
42
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
|
|
43
43
|
/** 字符串字典序比较 */
|
|
44
|
-
export declare function strcmp(l: string, r: string):
|
|
44
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
45
45
|
/** 比较 1.10.02 这种版本号 */
|
|
46
46
|
export declare function vercmp(l: string, r: string): number;
|
|
47
47
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|