@@ -52,13 +52,13 @@ function writeToFile(filePath, frontMatterVars){
52
52
let newYamlContent = updateFrontmatter ( frontMatterContent , { "cbbaseinfo" : frontMatterVars . cbbaseinfo , "cbparameters" : frontMatterVars . cbparameters } ) ;
53
53
newFileContent = originalfileContent . replace ( frontMatterMatch [ 0 ] , `---\n${ newYamlContent } ---` ) ;
54
54
} 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 } ) ;
56
56
newFileContent = frontMatter + originalfileContent ;
57
57
}
58
58
fs . writeFileSync ( filePath , newFileContent ) ;
59
59
} 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/> " ;
62
62
fs . writeFileSync ( filePath , newFileContent ) ;
63
63
}
64
64
}
@@ -86,10 +86,20 @@ if (codeboltChild && codeboltChild.children) {
86
86
} ,
87
87
"cbparameters" : {
88
88
"parameters" : [ ] ,
89
- "returndata" : " " ,
89
+ "returns" : {
90
+ "signatureTypeName" : " "
91
+ }
90
92
}
91
93
}
92
94
95
+ let parameterObj = {
96
+ "name" : " " ,
97
+ "typeName" : " " ,
98
+ "description" : " "
99
+ }
100
+
101
+
102
+
93
103
94
104
if ( CbProperties . type && CbProperties . type . declaration && CbProperties . type . declaration . children ) {
95
105
CbProperties . type . declaration . children . forEach ( CbFunctions => {
@@ -103,11 +113,15 @@ if (codeboltChild && codeboltChild.children) {
103
113
CbFunctions . type . declaration . signatures . forEach ( signature => {
104
114
if ( signature . parameters ) {
105
115
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 ) ;
108
122
} ) ;
109
123
}
110
- frontMatterVars . cbparameters . returndata = signature . type . name ;
124
+ frontMatterVars . cbparameters . returns . signatureTypeName = signature . type . name ;
111
125
} ) ;
112
126
}
113
127
0 commit comments