Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function end() {
if (/\.json$/.test(file)) {
this.queue('module.exports = ' + data);
this.queue(null);
}
else if (/\.cson$/.test(file)) {
this.queue('module.exports = ' + JSON.stringify(cson.parseSync(data)));
this.queue(null);
}
else if (/\.ya?ml$/.test(file)) {
var docs = [];
yaml.safeLoadAll(data, function(doc) {
docs.push(doc);
});
var result = docs.length===1 ? docs[0] : docs;
this.queue('module.exports = ' + JSON.stringify(result));
this.queue(null);
}
}