Files
ArtPlayer/refactor/baselines/site-vendor/console-stackoverflow/source.txt
T

15 lines
364 B
Plaintext

const customStringify = function (v) {
const cache = new Set();
return JSON.stringify(v, function (key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.has(value)) {
// Circular reference found, discard key
return;
}
// Store value in our set
cache.add(value);
}
return value;
});
};