Skip to content

Commit c8bc6e5

Browse files
committed
🆙 update: fix reflector
1 parent 4b9b711 commit c8bc6e5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/reflector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ function parsePath (basePath: string, targetPath: string) {
3535
return {
3636
contentPath: targetPath,
3737
component: parsed.name,
38-
hierarchy: parsedTargetPath
38+
hierarchy: [...parsedTargetPath, parsed.name]
3939
}
4040
}

test/reflector.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ test('reflectLocaleMessageMeta', () => {
3838
const [meta] = metaInfo
3939
expect(meta.contentPath).toBe(componentInfo.path)
4040
expect(meta.component).toBe('Modal')
41-
expect(meta.hierarchy).toEqual(['components', 'common'])
41+
expect(meta.hierarchy).toEqual(['components', 'common', 'Modal'])
4242
expect(meta.blocks.length).toBe(1)
4343
})

0 commit comments

Comments
 (0)