@abstract-foundation/agw-client
Version:
Abstract Global Wallet Client SDK
10 lines • 409 B
JavaScript
export const replaceBigInts = (obj, replacer) => {
if (typeof obj === 'bigint')
return replacer(obj);
if (Array.isArray(obj))
return obj.map((x) => replaceBigInts(x, replacer));
if (obj && typeof obj === 'object')
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, replaceBigInts(v, replacer)]));
return obj;
};
//# sourceMappingURL=replaceBigInts.js.map