File tree 1 file changed +6
-3
lines changed
packages/metadata/scripts
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,11 @@ function getCategory(ts: string) {
27
27
28
28
function getDescription ( ts : string ) {
29
29
const commentBlock = ts . slice ( ts . lastIndexOf ( '\n/**\n' ) + 1 )
30
- const s = commentBlock ?. match ( / ^ \* ( .+ ) $ / m) ?. [ 1 ] . trim ( )
31
- return s ?. startsWith ( '@' ) ? undefined : s
30
+ const lines = commentBlock . split ( '\n' )
31
+ . filter ( line => line . startsWith ( ' * ' ) )
32
+ . map ( line => line . slice ( 3 ) )
33
+ . filter ( line => ! line . startsWith ( '@reactive' ) && ! line . startsWith ( '@category' ) )
34
+ return lines . join ( '\n' )
32
35
}
33
36
34
37
function toCategoryName ( api : string ) {
@@ -43,7 +46,7 @@ async function getComposableMetadata(filename: string): Promise<FunctionMetadata
43
46
const _md = existsSync ( mdPath ) ? await fs . readFile ( mdPath , 'utf-8' ) : undefined // TODO: md
44
47
const original = getOriginalAPI ( ts )
45
48
const category = getCategory ( ts ) ?? ( original ? toCategoryName ( original ) : undefined )
46
- const description = getDescription ( ts ) ?? ( original ? `Reactive API for \`vscode::${ original } \`.` : undefined )
49
+ const description = getDescription ( ts ) || ( original ? `Reactive API for \`vscode::${ original } \`.` : undefined )
47
50
return {
48
51
name,
49
52
category,
You can’t perform that action at this time.
0 commit comments