jsutils

package
v0.0.0-...-3898052 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var (
	Object            = js.Global().Get("Object")
	Promise           = js.Global().Get("Promise")
	Error             = js.Global().Get("Error")
	Reflect           = js.Global().Get("Reflect")
	Uint8Array        = js.Global().Get("Uint8Array")
	Uint8ClampedArray = js.Global().Get("Uint8ClampedArray")
)

Functions

func Await

func Await(promise js.Value) (js.Value, error)

func Bytes2JS

func Bytes2JS(b []byte) js.Value

func JS2Bytes

func JS2Bytes(v js.Value) []byte

func JS2Go

func JS2Go[V any](v js.Value, typ js.Type, fn func(js.Value) V) (V, bool)

func NewArray

func NewArray[E any, S ~[]E](s S) js.Value

func NewError

func NewError(format string, args ...any) js.Value

func NewErrorWithStack

func NewErrorWithStack(stack, format string, args ...any) js.Value

func NewObject

func NewObject(kv ...any) js.Value

func NewPromise

func NewPromise(exec func(ctx context.Context, resolve, reject func(any))) js.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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