Skip to content

Commit 65c1a83

Browse files
committed
fix again the source parts
1 parent 55af56b commit 65c1a83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib/sources/hyperparamSource.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ function canParse(sourceId: string): boolean {
1616

1717
function getSourceParts(sourceId: string): SourcePart[] {
1818
const parts = sourceId.split('/')
19-
if (parts[parts.length - 1] === '') {
20-
parts.pop()
21-
}
22-
return [
19+
const sourceParts = [
2320
{ 'text': '/', 'sourceId': '' },
2421
...parts.map((part, depth) => {
2522
const slashSuffix = depth === parts.length - 1 ? '' : '/'
@@ -29,6 +26,10 @@ function getSourceParts(sourceId: string): SourcePart[] {
2926
}
3027
}),
3128
]
29+
if (sourceParts[sourceParts.length - 1]?.text === '') {
30+
sourceParts.pop()
31+
}
32+
return sourceParts
3233
}
3334

3435
function getKind(sourceId: string): FileKind {

0 commit comments

Comments
 (0)