@kenkaiiii/gg-ai 5.64.1 → 5.64.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4190,7 +4190,7 @@ function isMediaObject(value) {
|
|
|
4190
4190
|
function redactValue(value, options = {}) {
|
|
4191
4191
|
const maxDepth = options.maxDepth ?? 20;
|
|
4192
4192
|
const maxEntries = options.maxEntries ?? 1e4;
|
|
4193
|
-
const
|
|
4193
|
+
const ancestors = /* @__PURE__ */ new WeakSet();
|
|
4194
4194
|
let entries = 0;
|
|
4195
4195
|
const visit = (current, depth, sensitive = false) => {
|
|
4196
4196
|
if (typeof current === "string") {
|
|
@@ -4204,8 +4204,15 @@ function redactValue(value, options = {}) {
|
|
|
4204
4204
|
if (isBinary(current)) return current;
|
|
4205
4205
|
if (current instanceof Date) return new Date(current.getTime());
|
|
4206
4206
|
if (depth >= maxDepth) return TRUNCATED;
|
|
4207
|
-
if (
|
|
4208
|
-
|
|
4207
|
+
if (ancestors.has(current)) return CIRCULAR;
|
|
4208
|
+
ancestors.add(current);
|
|
4209
|
+
try {
|
|
4210
|
+
return cloneObject(current, depth);
|
|
4211
|
+
} finally {
|
|
4212
|
+
ancestors.delete(current);
|
|
4213
|
+
}
|
|
4214
|
+
};
|
|
4215
|
+
const cloneObject = (current, depth) => {
|
|
4209
4216
|
if (current instanceof Error) {
|
|
4210
4217
|
const error = {
|
|
4211
4218
|
name: current.name,
|