Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/rentals.picotech.app/public_html/node_modules/msgpackr/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { Transform } from 'stream'
import { Packr } from './pack.js'
import { Unpackr } from './unpack.js'
var DEFAULT_OPTIONS = {objectMode: true}
export class PackrStream extends Transform {
constructor(options) {
if (!options)
options = {}
options.writableObjectMode = true
super(options)
options.sequential = true
this.packr = options.packr || new Packr(options)
}
_transform(value, encoding, callback) {
this.push(this.packr.pack(value))
callback()
}
}
export class UnpackrStream extends Transform {
constructor(options) {
if (!options)
options = {}
options.objectMode = true
super(options)
options.structures = []
this.unpackr = options.unpackr || new Unpackr(options)
}
_transform(chunk, encoding, callback) {
if (this.incompleteBuffer) {
chunk = Buffer.concat([this.incompleteBuffer, chunk])
this.incompleteBuffer = null
}
let values
try {
values = this.unpackr.unpackMultiple(chunk)
} catch(error) {
if (error.incomplete) {
this.incompleteBuffer = chunk.slice(error.lastPosition)
values = error.values
}
else
throw error
} finally {
for (let value of values || []) {
if (value === null)
value = this.getNullValue()
this.push(value)
}
}
if (callback) callback()
}
getNullValue() {
return Symbol.for(null)
}
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.004 ]-- |