Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Clone (parent, opts) {
if (!(this instanceof Clone)) {
return new Clone(parent, opts)
}
var objectMode = parent._readableState.objectMode
opts = opts || {}
opts.objectMode = objectMode
this.parent = parent
PassThrough.call(this, opts)
forwardDestroy(parent, this)
parent.pipe(this)
// the events added by the clone should not count
// for starting the flow
// so we add the newListener handle after we are done
this.on('newListener', onDataClone)
this.on('resume', onResumeClone)
}
function Job (printer, req) {
PassThrough.call(this)
var attributes = utils.getAttributesForGroup(req._body, C.OPERATION_ATTRIBUTES_TAG)
this.compression = utils.getFirstValueForName(attributes, 'compression')
this._printer = printer
this._req = req
this.id = ++printer._jobId
this.state = C.JOB_PENDING
this.uri = printer.uri + this.id
this.name = utils.getFirstValueForName(attributes, 'job-name')
this.userName = utils.getFirstValueForName(attributes, 'requesting-user-name')
this.createdAt = new Date()
printer.add(this)
}
function Cloneable (stream, opts) {
if (!(this instanceof Cloneable)) {
return new Cloneable(stream, opts)
}
var objectMode = stream._readableState.objectMode
this._original = stream
this._clonesCount = 1
opts = opts || {}
opts.objectMode = objectMode
PassThrough.call(this, opts)
forwardDestroy(stream, this)
this.on('newListener', onData)
this.once('resume', onResume)
this._hasListener = true
}
var Source = function (self, offset) {
this._parent = self
this.offset = offset
PassThrough.call(this)
}
var Source = function (self, offset) {
this._parent = self
this.offset = offset
PassThrough.call(this)
}
function Cloneable (stream, opts) {
if (!(this instanceof Cloneable)) {
return new Cloneable(stream, opts)
}
var objectMode = stream._readableState.objectMode
this._original = stream
this._clonesCount = 1
opts = opts || {}
opts.objectMode = objectMode
PassThrough.call(this, opts)
forwardDestroy(stream, this)
this.on('newListener', onData)
this.once('resume', onResume)
this._hasListener = true
}
function GenericWriteChannel() {
if (!(this instanceof GenericWriteChannel)) {
return new GenericWriteChannel();
}
PassThrough.call(this, { objectMode: true, highWaterMark: 16 });
}
function GenericReadChannel() {
if (!(this instanceof GenericReadChannel)) {
return new GenericReadChannel();
}
PassThrough.call(this, { objectMode: true, highWaterMark: 16 });
}
var Source = function (self, offset) {
this._parent = self
this.offset = offset
PassThrough.call(this)
}
var Source = function (self, offset) {
this._parent = self
this.offset = offset
PassThrough.call(this)
}