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 targos committed Mar 27, 2018
1 parent 4db7848 commit 4c3465f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tools/doc/common.js
Expand Up @@ -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];
}
Expand All @@ -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 4c3465f

Please sign in to comment.