Files
Media-Coding-Web/node_modules/@smithy/util-waiter/dist-es/circularReplacer.js
2026-04-04 12:49:09 +08:00

13 lines
320 B
JavaScript

export const getCircularReplacer = () => {
const seen = new WeakSet();
return (key, value) => {
if (typeof value === "object" && value !== null) {
if (seen.has(value)) {
return "[Circular]";
}
seen.add(value);
}
return value;
};
};