jsvalue

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package jsvalue makes native rendering's JavaScript values straight from Go values: what JSON.parse would make of the JSON internal/jsonenc writes for them, value for value and in the same key order, without writing or parsing the JSON. Page data reaches components this way.

It follows jsonenc's rules: field names, omitempty and omitzero, embedded structs, nil slices as [], []byte as base64, sorted map keys. Values that encode themselves (json.Marshaler, encoding.TextMarshaler) are encoded by jsonenc and parsed, as are the rare struct tag options jsonenc leaves to encoding/json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(rt *js.Realm, v any) (js.Value, error)

Convert returns the JavaScript value for v in rt.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL