decord/source/13764_serialize.js

104 lines
2.8 KiB
JavaScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 13764
// Function ID: 13765
2026-07-29 08:29:29 +00:00
// Name: serialize
// Dependencies: []
2026-08-12 06:57:52 +00:00
// Module 13764 (serialize)
2026-07-29 08:29:29 +00:00
arg5.default = undefined;
let c0 = "~~~ zero ~~~";
2026-08-04 21:03:28 +00:00
if (typeof BigInt !== "undefined") {
2026-07-29 08:29:29 +00:00
const _BigInt = BigInt;
BigInt.prototype.toJSON = function() {
return this.toString();
};
}
arg5.default = function serialize(arg0) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
let closure_1 = [];
let closure_2 = [];
2026-08-04 21:03:28 +00:00
return JSON.stringify(arg0, function(arg0, obj) {
if (true === obj) {
2026-07-29 08:29:29 +00:00
return true;
2026-08-04 21:03:28 +00:00
} else if (obj === Infinity) {
2026-07-29 08:29:29 +00:00
return "~~~ Infinity ~~~";
2026-08-04 21:03:28 +00:00
} else if (obj === -Infinity) {
2026-07-29 08:29:29 +00:00
return "~~~ -Infinity ~~~";
2026-08-04 21:03:28 +00:00
} else if (0 === obj) {
2026-07-29 08:29:29 +00:00
return flag;
2026-08-04 21:03:28 +00:00
} else if (undefined === obj) {
2026-07-29 08:29:29 +00:00
return "~~~ undefined ~~~";
2026-08-04 21:03:28 +00:00
} else if (null === obj) {
2026-07-29 08:29:29 +00:00
return "~~~ null ~~~";
2026-08-04 21:03:28 +00:00
} else if (false === obj) {
2026-07-29 08:29:29 +00:00
return "~~~ false ~~~";
2026-08-04 21:03:28 +00:00
} else if (-0 === obj) {
2026-07-29 08:29:29 +00:00
return flag;
2026-08-04 21:03:28 +00:00
} else if ("" === obj) {
2026-07-29 08:29:29 +00:00
return "~~~ empty string ~~~";
} else {
if (flag) {
2026-08-04 21:03:28 +00:00
if (typeof obj === "object") {
if (obj.nativeEvent) {
return obj.nativeEvent;
2026-07-29 08:29:29 +00:00
}
}
}
2026-08-04 21:03:28 +00:00
if ("string" !== typeof obj) {
2026-07-29 08:29:29 +00:00
if ("number" !== tmp) {
if ("bigint" === tmp) {
2026-08-04 21:03:28 +00:00
return obj.toString();
2026-07-29 08:29:29 +00:00
} else if ("function" === tmp) {
2026-08-04 21:03:28 +00:00
const name = obj.name;
2026-07-29 08:29:29 +00:00
let str4 = "~~~ anonymous function ~~~";
if (null != name) {
str4 = "~~~ anonymous function ~~~";
if ("" !== name) {
const _HermesInternal = HermesInternal;
str4 = "~~~ " + name + "() ~~~";
}
}
return str4;
} else {
const _Symbol = Symbol;
2026-08-04 21:03:28 +00:00
if (obj[Symbol.iterator]) {
2026-07-29 08:29:29 +00:00
const _Array = Array;
2026-08-04 21:03:28 +00:00
if (!Array.isArray(obj)) {
2026-07-29 08:29:29 +00:00
const items = [];
2026-08-04 21:03:28 +00:00
HermesBuiltin.arraySpread(obj, 0);
2026-07-29 08:29:29 +00:00
return items;
}
}
let arr1 = length;
if (length.length > 0) {
const self = this;
const index = arr1.indexOf(this);
if (~index) {
arr1.splice(index + 1);
} else {
arr1.push(self);
}
if (~index) {
arr3.splice(index, Infinity, arg0);
} else {
arr3.push(arg0);
}
2026-08-04 21:03:28 +00:00
let str2 = obj;
if (~arr1.indexOf(obj)) {
2026-07-29 08:29:29 +00:00
str2 = "~~~ Circular Reference ~~~";
}
} else {
2026-08-04 21:03:28 +00:00
arr1 = arr1.push(obj);
str2 = obj;
2026-07-29 08:29:29 +00:00
}
return str2;
}
}
}
2026-08-04 21:03:28 +00:00
return obj;
2026-07-29 08:29:29 +00:00
}
});
};