//#region libs/shared/common/src/functions/utils/serialize.utils.ts
var e = (t) => typeof t == "bigint" ? t.toString() : typeof t != "object" || !t ? t : Array.isArray(t) ? t.map((t) => e(t)) : t instanceof Date ? t.toISOString() : Object.fromEntries(Object.entries(t).map(([t, n]) => [t, e(n)])), t = (e, t = null, n) => JSON.stringify(e, (e, n) => {
	let r = typeof t == "function" ? t(e, n) : n;
	return typeof r == "bigint" ? r.toString() : r;
}, n), n = (e) => JSON.stringify(e, (e, t) => typeof t == "bigint" ? `bigint:${t.toString()}` : t), r = (e) => JSON.parse(e, (e, t) => typeof t == "string" && t.startsWith("bigint:") ? BigInt(t.slice(7)) : t);
//#endregion
export { r as CustomJSONParse, n as CustomJSONStringify, t as safeJsonStringify, e as toJsonSafe };
