Skip to content

Commit 6b31fea

Browse files
authored
Fix typo in commondir.ts (#5334)
1 parent 1837203 commit 6b31fea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/commondir.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ export default function commondir(files: readonly string[]): string {
66
if (files.length === 1) return dirname(files[0]);
77
const commonSegments = files.slice(1).reduce(
88
(commonSegments, file) => {
9-
const pathSegements = file.split(/\/+|\\+/);
9+
const pathSegments = file.split(/\/+|\\+/);
1010
let index;
1111
for (
1212
index = 0;
13-
commonSegments[index] === pathSegements[index] &&
14-
index < Math.min(commonSegments.length, pathSegements.length);
13+
commonSegments[index] === pathSegments[index] &&
14+
index < Math.min(commonSegments.length, pathSegments.length);
1515
index++
1616
);
1717
return commonSegments.slice(0, index);

0 commit comments

Comments
 (0)