We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1837203 commit 6b31feaCopy full SHA for 6b31fea
src/utils/commondir.ts
@@ -6,12 +6,12 @@ export default function commondir(files: readonly string[]): string {
6
if (files.length === 1) return dirname(files[0]);
7
const commonSegments = files.slice(1).reduce(
8
(commonSegments, file) => {
9
- const pathSegements = file.split(/\/+|\\+/);
+ const pathSegments = file.split(/\/+|\\+/);
10
let index;
11
for (
12
index = 0;
13
- commonSegments[index] === pathSegements[index] &&
14
- index < Math.min(commonSegments.length, pathSegements.length);
+ commonSegments[index] === pathSegments[index] &&
+ index < Math.min(commonSegments.length, pathSegments.length);
15
index++
16
);
17
return commonSegments.slice(0, index);
0 commit comments