Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function compile(tree, file) {
const preface = select('preface', tree);
if (preface && !overwrite) {
file.fail(new Error('The changelog already exists.'), preface, 'addPreface');
}
tree.children = [
createPreface(parse(tplPreface)),
createRelease({
identifier: 'unreleased',
version: 'Unreleased',
unreleased: true
})
];
return tree;
}