@@ -52,13 +52,13 @@ function writeToFile(filePath, frontMatterVars){
5252 let newYamlContent = updateFrontmatter ( frontMatterContent , { "cbbaseinfo" : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
5353 newFileContent = originalfileContent . replace ( frontMatterMatch [ 0 ] , `---\n${ newYamlContent } ---` ) ;
5454 } else {
55- const frontMatter = createFrontMatter ( { name : frontMatterVars . data . name , "cblibrary " : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
55+ const frontMatter = createFrontMatter ( { name : frontMatterVars . data . name , "cbbaseinfo " : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
5656 newFileContent = frontMatter + originalfileContent ;
5757 }
5858 fs . writeFileSync ( filePath , newFileContent ) ;
5959 } else {
60- const frontMatter = createFrontMatter ( { name : frontMatterVars . data . name , "cblibrary " : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
61- newFileContent = frontMatter + "<CBBaseInfo/>" ;
60+ const frontMatter = createFrontMatter ( { name : frontMatterVars . data . name , "cbbaseinfo " : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
61+ newFileContent = frontMatter + "<CBBaseInfo/> \n <CBParameters/> " ;
6262 fs . writeFileSync ( filePath , newFileContent ) ;
6363 }
6464}
@@ -86,10 +86,20 @@ if (codeboltChild && codeboltChild.children) {
8686 } ,
8787 "cbparameters" : {
8888 "parameters" : [ ] ,
89- "returndata" : " " ,
89+ "returns" : {
90+ "signatureTypeName" : " "
91+ }
9092 }
9193 }
9294
95+ let parameterObj = {
96+ "name" : " " ,
97+ "typeName" : " " ,
98+ "description" : " "
99+ }
100+
101+
102+
93103
94104 if ( CbProperties . type && CbProperties . type . declaration && CbProperties . type . declaration . children ) {
95105 CbProperties . type . declaration . children . forEach ( CbFunctions => {
@@ -103,11 +113,15 @@ if (codeboltChild && codeboltChild.children) {
103113 CbFunctions . type . declaration . signatures . forEach ( signature => {
104114 if ( signature . parameters ) {
105115 signature . parameters . forEach ( param => {
106- frontMatterVars . cbparameters . parameters . push ( `${ param . name } : ${ param . type . name } ` ) ;
107- console . log ( `${ param . name } : ${ param . type . name } ` ) ;
116+ parameterObj = {
117+ "name" : param . name ,
118+ "typeName" : param . type . name ,
119+ "description" : param . comment && param . comment . text && param . comment . text . length > 0 ? param . comment . text [ 0 ] . text :''
120+ }
121+ frontMatterVars . cbparameters . parameters . push ( parameterObj ) ;
108122 } ) ;
109123 }
110- frontMatterVars . cbparameters . returndata = signature . type . name ;
124+ frontMatterVars . cbparameters . returns . signatureTypeName = signature . type . name ;
111125 } ) ;
112126 }
113127
0 commit comments