Documentation ¶
Overview ¶
Package jsbuiltin provides minimal wrappers around some JavasScript built-in functions.
Index ¶
- Constants
- func DecodeURI(uri string) (raw string, err error)
- func DecodeURIComponent(uri string) (raw string, err error)
- func EncodeURI(uri string) string
- func EncodeURIComponent(uri string) string
- func In(key string, obj *js.Object) (ok bool, err error)
- func InstanceOf(value interface{}, object *js.Object) bool
- func IsFinite(value interface{}) bool
- func IsNaN(value interface{}) bool
- func TypeOf(value interface{}) string
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
In returns true if key is a member of obj. An error is returned if obj is not a JavaScript object.
func InstanceOf ¶
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.
Types ¶
This section is empty.