pull/11838/head
Ben McCann 2 years ago
parent 52c5a71200
commit d55d2c6cd6

@ -238,33 +238,31 @@ function transform(name, dest) {
Block(node, context) { Block(node, context) {
if (!node.value.includes('PARAMETER')) return; if (!node.value.includes('PARAMETER')) return;
const value = node.value const value = /** @type {string} */ (node.value)
.split('\n') .split('\n')
.map( .map((line) => {
/** @param {string} line */ (line) => { if (line === ' * MESSAGE') {
if (line === ' * MESSAGE') { return messages[messages.length - 1]
return messages[messages.length - 1] .split('\n')
.split('\n') .map((line) => ` * ${line}`)
.map((line) => ` * ${line}`) .join('\n');
.join('\n');
}
if (line.includes('PARAMETER')) {
return vars
.map((name, i) => {
const optional = i >= group[0].vars.length;
return optional
? ` * @param {string | undefined | null} [${name}]`
: ` * @param {string} ${name}`;
})
.join('\n');
}
return line;
} }
)
.filter(/** @param {string} x */ (x) => x !== '') if (line.includes('PARAMETER')) {
return vars
.map((name, i) => {
const optional = i >= group[0].vars.length;
return optional
? ` * @param {string | undefined | null} [${name}]`
: ` * @param {string} ${name}`;
})
.join('\n');
}
return line;
})
.filter((x) => x !== '')
.join('\n'); .join('\n');
if (value !== node.value) { if (value !== node.value) {

Loading…
Cancel
Save