Server : nginx/1.20.1 System : Linux ccpf-production-2021 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 User : forge ( 1000) PHP Version : 7.4.21 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /lib/node_modules/pm2/node_modules/js-git/lib/ |
var Inflate = require('pako').Inflate;
var Binary = require('bodec').Binary;
// Byte oriented inflate stream. Wrapper for pako's Inflate.
//
// var inf = inflate();
// inf.write(byte) -> more - Write a byte to inflate's state-machine.
// Returns true if more data is expected.
// inf.recycle() - Reset the internal state machine.
// inf.flush() -> data - Flush the output as a binary buffer.
//
module.exports = function inflateStream() {
var inf = new Inflate();
var b = new Uint8Array(1);
var empty = new Binary(0);
return {
write: write,
recycle: recycle,
flush: Binary === Uint8Array ? flush : flushConvert
};
function write(byte) {
b[0] = byte;
inf.push(b);
return !inf.ended;
}
function recycle() { inf = new Inflate(); }
function flush() { return inf.result || empty; }
function flushConvert() {
return inf.result ? new Binary(inf.result) : empty;
}
};