safeStringifyReplacer() — astro Function Reference
Architecture documentation for the safeStringifyReplacer() function in utils.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 0e6f24d4_1492_e2de_23bc_f6c6a92b79e7["safeStringifyReplacer()"] 7a09e708_c090_71c0_8138_7343699b1865["utils.ts"] 0e6f24d4_1492_e2de_23bc_f6c6a92b79e7 -->|defined in| 7a09e708_c090_71c0_8138_7343699b1865 7bb3b03f_48da_08b4_1965_31b0ba5fc501["safeStringify()"] 7bb3b03f_48da_08b4_1965_31b0ba5fc501 -->|calls| 0e6f24d4_1492_e2de_23bc_f6c6a92b79e7 style 0e6f24d4_1492_e2de_23bc_f6c6a92b79e7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/content/utils.ts lines 887–903
function safeStringifyReplacer(seen: WeakSet<object>) {
return function (_key: string, value: unknown) {
if (!(value !== null && typeof value === 'object')) {
return value;
}
if (seen.has(value)) {
return '[Circular]';
}
seen.add(value);
const newValue = Array.isArray(value) ? [] : {};
for (const [key2, value2] of Object.entries(value)) {
(newValue as Record<string, unknown>)[key2] = safeStringifyReplacer(seen)(key2, value2);
}
seen.delete(value);
return newValue;
};
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does safeStringifyReplacer() do?
safeStringifyReplacer() is a function in the astro codebase, defined in packages/astro/src/content/utils.ts.
Where is safeStringifyReplacer() defined?
safeStringifyReplacer() is defined in packages/astro/src/content/utils.ts at line 887.
What calls safeStringifyReplacer()?
safeStringifyReplacer() is called by 1 function(s): safeStringify.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free