@code-pushup/utils 0.22.8 → 0.23.0
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/index.js +1 -2
- package/package.json +1 -1
- package/src/lib/git.d.ts +6 -1
package/index.js
CHANGED
|
@@ -1133,10 +1133,9 @@ async function toGitPath(path, git = simpleGit()) {
|
|
|
1133
1133
|
return formatGitPath(path, gitRoot);
|
|
1134
1134
|
}
|
|
1135
1135
|
function validateCommitData(commitData, options = {}) {
|
|
1136
|
-
const { throwError = false } = options;
|
|
1137
1136
|
if (!commitData) {
|
|
1138
1137
|
const msg = "no commit data available";
|
|
1139
|
-
if (throwError) {
|
|
1138
|
+
if (options?.throwError) {
|
|
1140
1139
|
throw new Error(msg);
|
|
1141
1140
|
} else {
|
|
1142
1141
|
console.warn(msg);
|
package/package.json
CHANGED
package/src/lib/git.d.ts
CHANGED
|
@@ -14,5 +14,10 @@ export declare function getGitRoot(git?: import("simple-git").SimpleGit): Promis
|
|
|
14
14
|
export declare function formatGitPath(path: string, gitRoot: string): string;
|
|
15
15
|
export declare function toGitPath(path: string, git?: import("simple-git").SimpleGit): Promise<string>;
|
|
16
16
|
export declare function validateCommitData(commitData: CommitData | null, options?: {
|
|
17
|
-
throwError?:
|
|
17
|
+
throwError?: true;
|
|
18
18
|
}): commitData is CommitData;
|
|
19
|
+
export declare function guardAgainstLocalChanges(git?: import("simple-git").SimpleGit): Promise<void>;
|
|
20
|
+
export declare function getCurrentBranchOrTag(git?: import("simple-git").SimpleGit): Promise<string>;
|
|
21
|
+
export declare function safeCheckout(branchOrHash: string, options?: {
|
|
22
|
+
forceCleanStatus?: true;
|
|
23
|
+
}, git?: import("simple-git").SimpleGit): Promise<void>;
|