File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/generators/legacy-json/utils Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,6 @@ function parseSignature(textRaw, values) {
215215}
216216
217217/**
218- *
219218 * @param {Array<import('mdast').PhrasingContent> } nodes
220219 */
221220function textJoin ( nodes ) {
@@ -266,10 +265,13 @@ function parseListItem(child) {
266265 // Extract name
267266 if ( RETURN_EXPRESSION . test ( text ) ) {
268267 current . name = 'return' ;
269-
270- let [ , returnType ] = text . match ( / ` ( .* ?) ` / ) ;
271- returnType = returnType . substring ( 1 , returnType . length - 1 ) ;
272- current . type = returnType ;
268+ // console.log(text)
269+ let matchResult = text . match ( / ` ( .* ?) ` / ) ;
270+ if ( matchResult ) {
271+ let returnType = matchResult [ 1 ] ;
272+ returnType = returnType . substring ( 1 , returnType . length - 1 ) ;
273+ current . type = returnType ;
274+ }
273275
274276 text = text . replace ( RETURN_EXPRESSION , '' ) ;
275277 } else {
@@ -311,7 +313,6 @@ function parseListItem(child) {
311313}
312314
313315/**
314- *
315316 * @param {import('../types.d.ts').HierarchizedEntry } entry
316317 * @param {import('../types.d.ts').Section } parentSection
317318 */
You can’t perform that action at this time.
0 commit comments