'use strict'; const yaml = require('js-yaml'); function isYAMLBlock(text) { return /^$/, ''); // js-yaml.safeLoad() throws on error. const meta = yaml.safeLoad(text); if (meta.added) { // Since semver-minors can trickle down to previous major versions, // features may have been added in multiple versions. meta.added = arrify(meta.added); } if (meta.deprecated) { // Treat deprecated like added for consistency. meta.deprecated = arrify(meta.deprecated); } meta.changes = meta.changes || []; return meta; } module.exports = { isYAMLBlock, extractAndParseYAML };