Bump artifact dependencies if CODEQL_ACTION_ARTIFACT_V2_UPGRADE enabled (#2482)
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com> Co-authored-by: Henry Mercer <henrymercer@github.com>
This commit is contained in:
parent
cf5b0a9041
commit
a196a714b8
5388 changed files with 2176737 additions and 71701 deletions
51
node_modules/unzip-stream/lib/parser-stream.js
generated
vendored
Normal file
51
node_modules/unzip-stream/lib/parser-stream.js
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
var Transform = require('stream').Transform;
|
||||
var util = require('util');
|
||||
var UnzipStream = require('./unzip-stream');
|
||||
|
||||
function ParserStream(opts) {
|
||||
if (!(this instanceof ParserStream)) {
|
||||
return new ParserStream(opts);
|
||||
}
|
||||
|
||||
var transformOpts = opts || {};
|
||||
Transform.call(this, { readableObjectMode: true });
|
||||
|
||||
this.opts = opts || {};
|
||||
this.unzipStream = new UnzipStream(this.opts);
|
||||
|
||||
var self = this;
|
||||
this.unzipStream.on('entry', function(entry) {
|
||||
self.push(entry);
|
||||
});
|
||||
this.unzipStream.on('error', function(error) {
|
||||
self.emit('error', error);
|
||||
});
|
||||
}
|
||||
|
||||
util.inherits(ParserStream, Transform);
|
||||
|
||||
ParserStream.prototype._transform = function (chunk, encoding, cb) {
|
||||
this.unzipStream.write(chunk, encoding, cb);
|
||||
}
|
||||
|
||||
ParserStream.prototype._flush = function (cb) {
|
||||
var self = this;
|
||||
this.unzipStream.end(function() {
|
||||
process.nextTick(function() { self.emit('close'); });
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
||||
ParserStream.prototype.on = function(eventName, fn) {
|
||||
if (eventName === 'entry') {
|
||||
return Transform.prototype.on.call(this, 'data', fn);
|
||||
}
|
||||
return Transform.prototype.on.call(this, eventName, fn);
|
||||
}
|
||||
|
||||
ParserStream.prototype.drainAll = function () {
|
||||
this.unzipStream.drainAll();
|
||||
return this.pipe(new Transform({ objectMode: true, transform: function (d, e, cb) { cb(); } }));
|
||||
}
|
||||
|
||||
module.exports = ParserStream;
|
||||
Loading…
Add table
Add a link
Reference in a new issue