Skip to content

Commit 360786d

Browse files
committed
some fixes
Signed-off-by: flakey5 <[email protected]>
1 parent ffdfe06 commit 360786d

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

src/generators/legacy-json/index.mjs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,19 @@ export default {
4949
return section;
5050
};
5151

52-
await Promise.all(headNodes.map(async node => {
53-
// Get the json for the node's section
54-
const section = processModuleNodes(node);
55-
56-
// Write it to the output file
57-
await writeFile(
58-
join(output, `${node.api}.json`),
59-
JSON.stringify(section),
60-
'utf8'
61-
);
62-
}));
52+
await Promise.all(
53+
headNodes.map(async node => {
54+
// Get the json for the node's section
55+
const section = processModuleNodes(node);
56+
57+
// Write it to the output file
58+
await writeFile(
59+
join(output, `${node.api}.json`),
60+
JSON.stringify(section),
61+
'utf8'
62+
);
63+
})
64+
);
6365

6466
return generatedValues;
6567
},

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ function parseSignature(textRaw, values) {
9494
* Extract a list of the signatures from the method's declaration
9595
* @example `[sources[, options]]`
9696
*/
97-
let [, declaredParameters] = textRaw.match(PARAM_EXPRESSION) || [];
97+
let [, declaredParameters] = `\`${textRaw}\``.match(PARAM_EXPRESSION) || [];
9898

9999
if (!declaredParameters) {
100-
return;
100+
signature.params = rawParameters;
101+
102+
return signature;
101103
}
102104

103105
/**
@@ -175,8 +177,8 @@ function parseSignature(textRaw, values) {
175177
for (const otherParam of rawParameters) {
176178
if (declaredParameter === otherParam.name) {
177179
// Found a matching one
178-
// TODO break?
179180
parameter = otherParam;
181+
break;
180182
} else if (otherParam.options) {
181183
// Found a matching one in the parameter's options
182184
for (const option of otherParam.options) {
@@ -265,7 +267,7 @@ function parseListItem(child) {
265267
// Extract name
266268
if (RETURN_EXPRESSION.test(text)) {
267269
current.name = 'return';
268-
// console.log(text)
270+
269271
let matchResult = text.match(/`(.*?)`/);
270272
if (matchResult) {
271273
let returnType = matchResult[1];

0 commit comments

Comments
 (0)