filename stringlengths 20 188 | language stringclasses 3
values | AST-segments stringlengths 0 204k |
|---|---|---|
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | er);
unpipe();
dest.removeListener('error' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onerror);
if (listenerCount(dest |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'error') === 0) dest.emit('error' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | er);
}
// Make sure our error handler is attached before userland ones.
prependListener(dest |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'error' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onerror);
// Both close and finish should trigger unpipe |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | but only once.
function onclose() {
dest.removeListener('finish' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onfinish);
unpipe();
}
dest.once('close' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onclose);
unpipe();
}
dest.once('finish' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function () {
var state = src._readableState;
debug('pipeOnDrain' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state.awaitDrain);
if (state.awaitDrain) state.awaitDrain--;
if (state.awaitDrain === 0 && src.listeners('data').length) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function (dest) {
var state = this._readableState;
// if we're not piping any... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | then do nothing.
if (state.pipesCount === 0) return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | but it's not the right one.
if (dest && dest !== state.pipes) return this;
if (!dest) dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest) dest.emit('unpipe' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var _i = 0; _i < len; _i++) {
dest... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this);
}return this;
}
// try to find the right one.
var i = indexOf(state.pipes |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | dest);
if (i === -1) return this;
state.pipes.splice(i |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 1);
state.pipesCount -= 1;
if (state.pipesCount === 1) state.pipes = state.pipes[0];
dest.emit('unpipe' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | fn) {
var res = EventEmitter.prototype.on.call(this |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | ev |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | fn);
if (ev === 'data') {
// Start flowing on next tick if stream isn't explicitly paused
if (this._readableState.flowing !== false) this.resume();
} else if (ev === 'readable') {
var state = this._readableState;
if (!state.endEmitted && !state.readableListening) {
state.readabl... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this);
} else if (state.length) {
emitReadable(this);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
function nReadingNextTick(self) {
debug('readable nexttick read 0');
self.read(0);
}
// pause() and resume() are remnants of the... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | then switch into old mode.
Readable.prototype.resume = function () {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
resume(this |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state);
}
return this;
};
function resume(stream |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
nextTick(resume_ |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | stream |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state);
}
}
function resume_(stream |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state) {
if (!state.reading) {
debug('resume read 0');
stream.read(0);
}
state.resumeScheduled = false;
state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
debug('call... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state.flowing);
while (state.flowing && stream.read() !== null) {}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
var state = this._readableStat... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | function () {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) self.push(chunk);
}
self.push(null);
});
stream.on('data' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | function (chunk) {
debug('wrapped data');
if (state.decoder) chunk = state.decoder.write(chunk);
// don't skip over falsy values in objectMode
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
var ret ... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | arguments);
};
}(i);
}
}
// proxy certain important events.
var events = ['error' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'close' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'destroy' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'pause' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'resume'];
forEach(events |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | function (ev) {
stream.on(ev |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | self.emit.bind(self |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | ev));
});
// when we try to consume some more bytes |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | simply unpause the
// underlying stream.
self._read = function (n) {
debug('wrapped _read' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | n);
if (paused) {
paused = false;
stream.resume();
}
};
return self;
};
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This functio... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | so please take care when making
// changes to the function body.
function fromList(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state) {
// nothing buffered
if (state.length === 0) return null;
var ret;
if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
// read it all |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | truncate the list
if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
state.buffer.clear();
} else {
// read part of list
ret = fromListPartial(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state.buffer |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state.decoder);
}
return ret;
}
// Extracts only enough buffered data to satisfy the amount requested.
// This function is designed to be inlinable |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | so please take care when making
// changes to the function body.
function fromListPartial(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | list |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | hasStrings) {
var ret;
if (n < list.head.data.length) {
// slice is the same for buffers and strings
ret = list.head.data.slice(0 |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | n);
list.head.data = list.head.data.slice(n);
} else if (n === list.head.data.length) {
// first chunk is a perfect match
ret = list.shift();
} else {
// result spans more than one buffer
ret = hasStrings ? copyFromBufferString(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | list) : copyFromBuffer(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | list);
}
return ret;
}
// Copies a specified amount of characters from the list of buffered data
// chunks.
// This function is designed to be inlinable |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | so please take care when making
// changes to the function body.
function copyFromBufferString(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | list) {
var p = list.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0 |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
list.length -= c;
retu... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | so please take care when making
// changes to the function body.
function copyFromBuffer(n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | list) {
var ret = Buffer.allocUnsafe(n);
var p = list.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | ret.length - n |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 0 |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) list.head = p.next;else list.head = list.tail = null;
} else {
list.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
list.length -= c;
ret... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | then that is a
// bug in node. Should never happen.
if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
nextTick(endReadableNT |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | state |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | stream);
}
}
function endReadableNT(state |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | stream) {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
}
function forEach(xs |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | f) {
for (var i = 0 |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | l = xs.length; i < l; i++) {
f(xs[i] |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | i);
}
}
function indexOf(xs |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | x) {
for (var i = 0 |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
// A bit simpler than readable streams.
Writable.WritableState = WritableState;
inherits$1(Writable |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | EventEmitter);
function nop() {}
function WriteReq(chunk |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | encoding |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
this.next = null;
}
function WritableState(options |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | stream) {
Object.defineProperty(this |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | 'buffer' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | {
get: deprecate(function () {
return this.getBuffer();
} |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
});
options = options || {};
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (stream instanceof Duplex) this.objectMode = t... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var defaultHwm = this.objectMode ? 16 : 16 * 1024;
this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
// cast to ints.
this.highWaterMark = ~ ~this.highWaterMa... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === fa... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to b... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | // or on a later tick. We set this to true at first |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | which
// may call the _write() callback in the same tick |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | cb)
this.onwrite = function (er) {
onwrite(stream |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | er);
};
// the callback that the user supplies to write(chunk |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | encoding |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.bufferedRequest = null;
this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | there is always
// one allocated and free to use |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | and we maintain at most two
this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function writableStateGetBuffer() {
var current = this.bufferedRequest;
var out = [];
while (current) {
out.push(current);
current = current.next;
}
return out;
... |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | though they're not
// instanceof Writable |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | they're instanceof Readable.
if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
this._writableState = new WritableState(options |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | this);
// legacy.
this.writable = true;
if (options) {
if (typeof options.write === 'function') this._write = options.write;
if (typeof options.writev === 'function') this._writev = options.writev;
}
EventEmitter.call(this);
}
// Otherwise people can pipe Writable streams |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | which is just wrong.
Writable.prototype.pipe = function () {
this.emit('error' |
pratsatya_uqt-serverside-nft-ops_node_modules_stream-transform_dist_iife_sync.js | javascript | new Error('Cannot pipe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.