Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! feat(json): add legacy JSON generator
Browse files Browse the repository at this point in the history
  • Loading branch information
avivkeller committed Nov 12, 2024
1 parent 074570e commit 5b448fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/generators/legacy-json/utils/buildSection.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ function parseListItem(child, entry) {
let text = current.textRaw;

// Extract `name`, `type`, `default`, and `desc` fields with helper functions
text = extractPattern(text, RETURN_EXPRESSION, 'name') || text;
if (RETURN_EXPRESSION.test(text)) {
current.name = 'return';
text = text.replace(RETURN_EXPRESSION, '');
}
text = current.name ? text : extractPattern(text, NAME_EXPRESSION, 'name');
text = extractPattern(text, TYPE_EXPRESSION, 'type');
text = extractPattern(text, DEFAULT_EXPRESSION, 'default');
Expand Down

0 comments on commit 5b448fe

Please sign in to comment.