mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
tools: fix nits in tools/doc/common.js
PR-URL: https://github.com/nodejs/node/pull/19599 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
11b8d4793f
commit
fe4e511ae8
1 file changed
+2
-7
+2
-7
@@ -3,11 +3,9 @@
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
function isYAMLBlock(text) {
|
||||
return !!text.match(/^<!-- YAML/);
|
||||
return /^<!-- YAML/.test(text);
|
||||
}
|
||||
|
||||
exports.isYAMLBlock = isYAMLBlock;
|
||||
|
||||
function arrify(value) {
|
||||
return Array.isArray(value) ? value : [value];
|
||||
}
|
||||
@@ -32,11 +30,8 @@ function extractAndParseYAML(text) {
|
||||
}
|
||||
|
||||
meta.changes = meta.changes || [];
|
||||
for (const entry of meta.changes) {
|
||||
entry.description = entry.description.replace(/^\^\s*/, '');
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
exports.extractAndParseYAML = extractAndParseYAML;
|
||||
module.exports = { isYAMLBlock, extractAndParseYAML };
|
||||
Reference in new issue
Block a user