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:
Vse Mozhet Byt authored and Myles Borins committed 2018-08-17 15:50:07 -04:00
1 parent 11b8d4793f
commit fe4e511ae8
1 file changed
+2 -7
+2 -7
View File
@@ -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 };