Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return through.obj(function (file, enc, cb) {
if (!file.isNull()) {
return vinylToString(file, enc)
.then((xml) => transformer(transformations, parseXmlString(xml), nsUri))
.then((transformedXml) => {
const contents = getContents(file, transformedXml);
Object.assign(file, { contents });
this.push(file);
cb();
})
.catch(cb);
}
this.push(file);
return cb();
});
}