mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
tools: fix stability index generation
PR-URL: https://github.com/nodejs/node/pull/45346 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
This commit is contained in:
parent
7903f944ec
commit
7e581c88fc
@ -104,10 +104,10 @@ export function jsonAPI({ filename }) {
|
||||
nodes.slice(0, i).every((node) => node.type === 'list')
|
||||
) {
|
||||
const text = textJoin(node.children[0].children, file);
|
||||
const stability = text.match(stabilityExpr);
|
||||
const stability = stabilityExpr.exec(text);
|
||||
if (stability) {
|
||||
current.stability = parseInt(stability[1], 10);
|
||||
current.stabilityText = stability[2].trim();
|
||||
current.stabilityText = stability[2].replaceAll('\n', ' ').trim();
|
||||
delete nodes[i];
|
||||
}
|
||||
}
|
||||
|
@ -30,12 +30,17 @@ function collectStability(data) {
|
||||
if (mod.displayName && mod.stability >= 0) {
|
||||
const link = mod.source.replace('doc/api/', '').replace('.md', '.html');
|
||||
|
||||
let { stabilityText } = mod;
|
||||
if (stabilityText.includes('. ')) {
|
||||
stabilityText = stabilityText.slice(0, stabilityText.indexOf('.'));
|
||||
}
|
||||
|
||||
stability.push({
|
||||
api: mod.name,
|
||||
displayName: mod.textRaw,
|
||||
link: link,
|
||||
stability: mod.stability,
|
||||
stabilityText: `(${mod.stability}) ${mod.stabilityText}`,
|
||||
stabilityText: `(${mod.stability}) ${stabilityText}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user