Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert.object(opts, 'opts');
assert.optionalString(opts.specExtra, 'opts.specExtra');
// Gather template data.
var data = {
name: this.name,
date: new Date(),
spec: this.bashCompletionSpec()
};
if (opts.specExtra) {
data.spec += '\n\n' + opts.specExtra;
}
// Render template.
var template = fs.readFileSync(
dashdash.BASH_COMPLETION_TEMPLATE_PATH, 'utf8');
return renderTemplate(template, data);
};