Skip to content

Commit a1c6190

Browse files
FloffahCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 87f756b commit a1c6190

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/lib/generateBundle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { generateDtsBundle } from "dts-bundle-generator";
22
import { randomBytes } from "node:crypto";
33
import { rmSync, writeFileSync } from "node:fs";
4-
import { sep as pathSeparator, resolve } from "node:path";
4+
import { dirname, sep as pathSeparator, resolve } from "node:path";
55
import ts from "typescript";
66

77
function getHighestCommonDirectory(paths: string[]): string {
@@ -16,7 +16,7 @@ function getHighestCommonDirectory(paths: string[]): string {
1616
}
1717

1818
if (otherPaths.length === 0) {
19-
return firstPath.replace(/[\\/][^\\/]+$/, "");
19+
return dirname(firstPath);
2020
}
2121

2222
const [firstParts, ...otherPathParts] = paths.map((p) =>

0 commit comments

Comments
 (0)