download
raw
569 Bytes
const omitCircularRefsReplacer = (
replacer: ((this: any, key: string, value: any) => any) | undefined,
) => {
const known = new WeakSet();
return (_, value) => {
if (replacer) {
value = replacer(_, value);
}
if (typeof value === 'object' && value !== null) {
if (known.has(value)) {
return;
}
known.add(value);
}
return value;
};
};
export const stringify = <T>(
object: T,
replacer?: (this: any, key: string, value: any) => any,
): string => JSON.stringify(object, omitCircularRefsReplacer(replacer));

Xet Storage Details

Size:
569 Bytes
·
Xet hash:
b7e9d5d254bac818449f7b2288e521ed1b6e0a0046d6a7adcb6c6189f415717f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.