Skip to content

serialize

Serialize function that supports bigint and Map.

Import

ts
import { serialize } from '@wagmi/core'
import { serialize } from '@wagmi/core'

Usage

ts
import { serialize } from '@wagmi/core'

const result = serialize({ foo: 'wagmi', bar: 123n })
import { serialize } from '@wagmi/core'

const result = serialize({ foo: 'wagmi', bar: 123n })

Parameters

value

any

The value to stringify.

replacer

(key: string, value: any) => any

A custom replacer function for handling standard values.

indent

number | null | undefined

The number of spaces to indent the output by.

circularReplacer

A custom replacer function for handling circular values.

Return Type

string

Stringified value.

Released under the MIT License.