Skip to content

Commit 5b448fe

Browse files
committed
fixup! fixup! fixup! fixup! feat(json): add legacy JSON generator
1 parent 074570e commit 5b448fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/generators/legacy-json/utils/buildSection.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ function parseListItem(child, entry) {
9696
let text = current.textRaw;
9797

9898
// Extract `name`, `type`, `default`, and `desc` fields with helper functions
99-
text = extractPattern(text, RETURN_EXPRESSION, 'name') || text;
99+
if (RETURN_EXPRESSION.test(text)) {
100+
current.name = 'return';
101+
text = text.replace(RETURN_EXPRESSION, '');
102+
}
100103
text = current.name ? text : extractPattern(text, NAME_EXPRESSION, 'name');
101104
text = extractPattern(text, TYPE_EXPRESSION, 'type');
102105
text = extractPattern(text, DEFAULT_EXPRESSION, 'default');

0 commit comments

Comments
 (0)