JSONMap defines a map that is safe for json and db read/write.

Type Parameters

  • T

Hierarchy

Methods

  • Get retrieves a single value from the current JSONMap[T].

    This helper was added primarily to assist the goja integration since custom map types don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods).

    Parameters

    • key: string

    Returns T

  • MarshalJSON implements the [json.Marshaler] interface.

    Returns string | number[]

  • Scan implements [sql.Scanner] interface to scan the provided value into the current JSONMap[T] instance.

    Parameters

    • value: any

    Returns void

  • Set sets a single value in the current JSONMap[T].

    This helper was added primarily to assist the goja integration since custom map types don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods).

    Parameters

    • key: string
    • value: T

    Returns void

  • String returns the string representation of the current json map.

    Returns string

  • Value implements the [driver.Valuer] interface.

    Returns any

Generated using TypeDoc