jsbuiltin

package
v0.0.0-...-4eea09c Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2018 License: BSD-3-Clause, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package jsbuiltin provides minimal wrappers around some JavasScript built-in functions.

Index

Constants

View Source
const (
	TypeUndefined = "undefined"
	TypeNull      = "null"
	TypeObject    = "object"
	TypeBoolean   = "boolean"
	TypeNumber    = "number"
	TypeString    = "string"
	TypeFunction  = "function"
	TypeSymbol    = "symbol"
)

Type constants represent the JavaScript builtin types, which may be returned by TypeOf().

Variables

This section is empty.

Functions

func DecodeURI

func DecodeURI(uri string) (raw string, err error)

DecodeURI decodes a Uniform Resource Identifier (URI) previously created by EncodeURI() or by a similar routine. If the underlying JavaScript function throws an error, it is returned as an error.

func DecodeURIComponent

func DecodeURIComponent(uri string) (raw string, err error)

DecodeURIComponent decodes a Uniform Resource Identifier (URI) component previously created by EncodeURIComponent() or by a similar routine. If the underlying JavaScript function throws an error, it is returned as an error.

func EncodeURI

func EncodeURI(uri string) string

EncodeURI encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).

func EncodeURIComponent

func EncodeURIComponent(uri string) string

EncodeURIComponent encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters).

func In

func In(key string, obj *js.Object) (ok bool, err error)

In returns true if key is a member of obj. An error is returned if obj is not a JavaScript object.

func InstanceOf

func InstanceOf(value interface{}, object *js.Object) bool

InstanceOf returns true if value is an instance of object according to the built-in 'instanceof' operator. `object` must be a *js.Object representing a javascript constructor function.

func IsFinite

func IsFinite(value interface{}) bool

IsFinite determines whether the passed value is a finite number, and returns true if it is. If needed, the parameter is first converted to a number.

func IsNaN

func IsNaN(value interface{}) bool

IsNaN determines whether a value is NaN (Not-a-Number) or not. A return value of true indicates the input value is considered NaN by JavaScript.

func TypeOf

func TypeOf(value interface{}) string

TypeOf returns the JavaScript type of the passed value

Types

This section is empty.

Jump to

Keyboard shortcuts

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