Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// });
// }, function(err) {
// console.log('done');
// console.log(durations);
// }
//);
function SimpleProtocol(options) {
if (!(this instanceof SimpleProtocol))
return new SimpleProtocol(options);
Transform.call(this, options);
}
SimpleProtocol.prototype = Object.create(
Transform.prototype, { constructor: { value: SimpleProtocol }});
SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
chunk = chunk.toString().toUpperCase();
this.push(chunk);
};
var count = 0;
var durations = [];
//var reader = fs.createReadStream('in.json');
//var parser = new SimpleProtocol();
//var writer = fs.createWriteStream('out.csv');
//var start = Date.now();
//reader.pipe(parser).pipe(writer);
//reader.on('end', function() {
// var duration = Date.now() - start;
// package wrapper
var Transform = require('readable-stream').Transform,
umd = require('umd');
function WrapCJS(options) {
Transform.call(this, options);
this.opts = options || {};
this.first = true;
}
WrapCJS.prototype = Object.create(Transform.prototype, { constructor: { value: WrapCJS }});
WrapCJS.prototype.writePrelude = function() {
if (!this.first) {
return;
}
if (this.opts.standalone) {
return this.push(umd.prelude(this.opts.standalone).trim() + 'return ');
}
if (false) {
return this.push((this.opts.externalRequireName || 'require') + '=');
}
};
WrapCJS.prototype._transform = function(chunk, encoding, done) {
if (this.first) {
this.writePrelude();
deps.write = function(dep, encoding, callback) {
var path = dep.path;
//console.log('dep', dep);
if (path in pack._loading) {
pack._loading[path]++;
}
else {
pack._loading[path] = 1;
}
Transform.prototype.write.call(this, dep, encoding, callback);
};
var Transform = require('readable-stream').Transform;
function WrapCJS(options) {
Transform.call(this, options);
this.opts = options || {};
this.length = 0;
}
WrapCJS.prototype = Object.create(Transform.prototype, { constructor: { value: WrapCJS }});
WrapCJS.prototype._transform = function(chunk, encoding, done) {
this.length += chunk.length;
done(null, chunk);
};
WrapCJS.prototype._flush = function(done) {
if (this.opts.onDone) {
this.opts.onDone(this.length);
}
done();
};
module.exports = function(options) {
var instance = new WrapCJS(options);
return {
ArchiveOutputStream.prototype.write = function(chunk, cb) {
if (chunk) {
this.offset += chunk.length;
}
return Transform.prototype.write.call(this, chunk, cb);
};
var Transform = require('readable-stream').Transform;
function WrapCJS(options) {
Transform.call(this, options);
this.opts = options || {};
this.first = true;
}
WrapCJS.prototype = Object.create(Transform.prototype, { constructor: { value: WrapCJS }});
WrapCJS.prototype.writeFirst = function() {
this.push('function(module, exports, require){\n');
if(this.opts['source-url']) {
this.push('eval(');
}
this.first = false;
};
WrapCJS.prototype._transform = function(chunk, encoding, done) {
if(this.first) {
this.writeFirst();
}
if(this.opts['source-url']) {
this.push(JSON.stringify(chunk.toString())+'+');
} else {
return;
}
if (context) {
that.push(context);
}
if (that._lastDone) {
that._lastDone();
that._lastDone = null;
}
};
}
SolutionsFilterStream.prototype = Object.create(
Transform.prototype,
{ constructor: { value: SolutionsFilterStream } }
);
SolutionsFilterStream.prototype._transform = function solutionsTransform(context, encoding, done) {
this._lastDone = done;
this._filter(context, this._doPush);
};
module.exports = SolutionsFilterStream;
var Transform = require('readable-stream').Transform;
function WrapCJS(options) {
Transform.call(this, options);
this.opts = options || {};
this.first = true;
this.buffer = '';
}
WrapCJS.prototype = Object.create(Transform.prototype, { constructor: { value: WrapCJS }});
WrapCJS.prototype.writeFirst = function() {
this.push('function(module, exports, require){\n');
this.push('module.exports = ');
this.first = false;
};
WrapCJS.prototype._transform = function(chunk, encoding, done) {
if(this.first) {
this.writeFirst();
}
this.buffer += chunk;
done();
};
WrapCJS.prototype._flush = function(done) {
, wrapCallback = require('./utilities').wrapCallback;
function NavigatorStream(options) {
if (!(this instanceof NavigatorStream)) {
return new NavigatorStream(options);
}
options.objectMode = true;
Transform.call(this, options);
this._lastElement = options._lastElement;
}
NavigatorStream.prototype = Object.create(
Transform.prototype,
{ constructor: { value: NavigatorStream } }
);
NavigatorStream.prototype._transform = function(data, encoding, done) {
var value = data[this._lastElement.name] || this._lastElement;
this.push(value);
done();
};
function Navigator(options) {
if (!(this instanceof Navigator)) {
return new Navigator(options);
}
this.db = options.db;
this._conditions = [];
Pickup.prototype._destroy = function (er, cb) {
this.invalidate()
Transform.prototype._destroy.call(this, er, cb)
}