Skip to content

Commit

Permalink
tools: fix nits in tools/doc/common.js
Browse files Browse the repository at this point in the history
PR-URL: #19599
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
vsemozhetbyt authored and MylesBorins committed Aug 17, 2018
1 parent 11b8d47 commit fe4e511
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tools/doc/common.js
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit fe4e511

Please sign in to comment.