Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function transformer(code) {
var stream = new Transform;
stream._transform = function(chunk, encoding, callback) {
return callback(null, chunk);
};
stream._flush = function(callback) {
if (code) {
stream.push(code);
}
return callback();
};
return stream;
}
function acornShimComplete() {
var tr = new stream.Transform
var buffer = "";
tr._transform = function(chunk, _, callback) {
buffer += chunk.toString("utf8");
callback();
};
tr._flush = function (callback) {
tr.push(buffer.replace(ACORN_PLACEHOLDER, "module.exports = typeof acorn != 'undefined' ? acorn : require(\"./acorn\")"));
callback(null);
};
return tr;
}
function acornShimComplete() {
var tr = new stream.Transform
var buffer = "";
tr._transform = function(chunk, _, callback) {
buffer += chunk.toString("utf8");
callback();
};
tr._flush = function (callback) {
tr.push(buffer.replace(ACORN_PLACEHOLDER, "module.exports = typeof acorn != 'undefined' ? acorn : require(\"./acorn\")"));
callback(null);
};
return tr;
}
constructor(opts, transformOpts) {
this.input = new Transform(transformOpts);
this.input._read = () => {};
this.transform = new JSON2CSVTransform(opts, transformOpts);
this.processor = this.input.pipe(this.transform);
}
function gulpMap(map) {
var Transform = require('stream').Transform;
var transformer = new Transform({objectMode: true});
transformer._transform = function(srcFile, encoding, done) {
var dest = map(srcFile);
this.push(dest || srcFile);
done();
};
transformer._flush = function(done) { done(); };
return transformer;
}