UNPKG

viem

Version:

TypeScript Interface for Ethereum

14 lines (11 loc) 398 B
import type { ErrorType } from '../errors/utils.js' export type StringifyErrorType = ErrorType export const stringify: typeof JSON.stringify = (value, replacer, space) => JSON.stringify( value, (key, value_) => { const value = typeof value_ === 'bigint' ? value_.toString() : value_ return typeof replacer === 'function' ? replacer(key, value) : value }, space, )