This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/tslog/cjs/internal/jsonStringifyRecursive.js
T

22 lines
639 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonStringifyRecursive = jsonStringifyRecursive;
function jsonStringifyRecursive(obj) {
const cache = new Set();
return JSON.stringify(obj, (key, value) => {
if (typeof value === "object" && value !== null) {
if (cache.has(value)) {
return "[Circular]";
}
cache.add(value);
}
if (typeof value === "bigint") {
return `${value}`;
}
if (typeof value === "undefined") {
return "[undefined]";
}
return value;
});
}