Documentation ¶
Index ¶
- func IsArray(_ context.Context, args ...core.Value) (core.Value, error)
- func IsBinary(_ context.Context, args ...core.Value) (core.Value, error)
- func IsBool(_ context.Context, args ...core.Value) (core.Value, error)
- func IsDateTime(_ context.Context, args ...core.Value) (core.Value, error)
- func IsFloat(_ context.Context, args ...core.Value) (core.Value, error)
- func IsHTMLDocument(_ context.Context, args ...core.Value) (core.Value, error)
- func IsHTMLElement(_ context.Context, args ...core.Value) (core.Value, error)
- func IsInt(_ context.Context, args ...core.Value) (core.Value, error)
- func IsNaN(_ context.Context, args ...core.Value) (core.Value, error)
- func IsNone(_ context.Context, args ...core.Value) (core.Value, error)
- func IsObject(_ context.Context, args ...core.Value) (core.Value, error)
- func IsString(_ context.Context, args ...core.Value) (core.Value, error)
- func RegisterLib(ns core.Namespace) error
- func ToArray(ctx context.Context, args ...core.Value) (core.Value, error)
- func ToBool(_ context.Context, args ...core.Value) (core.Value, error)
- func ToDateTime(_ context.Context, args ...core.Value) (core.Value, error)
- func ToFloat(_ context.Context, args ...core.Value) (core.Value, error)
- func ToInt(_ context.Context, args ...core.Value) (core.Value, error)
- func ToString(_ context.Context, args ...core.Value) (core.Value, error)
- func TypeName(_ context.Context, args ...core.Value) (core.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsArray ¶
IS_ARRAY checks whether value is an array value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is array, otherwise false.
func IsBinary ¶
IS_BINARY checks whether value is a binary value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is binary, otherwise false.
func IsBool ¶
IS_BOOL checks whether value is a boolean value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is boolean, otherwise false.
func IsDateTime ¶
IS_DATETIME checks whether value is a date time value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is date time, otherwise false.
func IsFloat ¶
IS_FLOAT checks whether value is a float value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is float, otherwise false.
func IsHTMLDocument ¶
IS_HTML_DOCUMENT checks whether value is a HTMLDocument value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is HTMLDocument, otherwise false.
func IsHTMLElement ¶
IS_HTML_ELEMENT checks whether value is a HTMLElement value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is HTMLElement, otherwise false.
func IsInt ¶
IS_INT checks whether value is a int value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is int, otherwise false.
func IsNaN ¶
IS_NAN checks whether value is NaN. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is NaN, otherwise false.
func IsNone ¶
IS_NONE checks whether value is a none value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is none, otherwise false.
func IsObject ¶
IS_OBJECT checks whether value is an object value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is object, otherwise false.
func IsString ¶
IS_STRING checks whether value is a string value. @param {Any} value - Input value of arbitrary type. @return {Boolean} - Returns true if value is string, otherwise false.
func RegisterLib ¶ added in v0.8.0
func ToArray ¶
TO_ARRAY takes an input value of any type and convert it into an array value. None is converted to an empty array Boolean values, numbers and strings are converted to an array containing the original value as its single element Arrays keep their original value Objects / HTML nodes are converted to an array containing their attribute values as array elements. @param {Any} input - Input value of arbitrary type. @return {Any[]} - An array value.
func ToBool ¶
TO_BOOL takes an input value of any type and converts it into the appropriate boolean value. None is converted to false Numbers are converted to true, except for 0, which is converted to false Strings are converted to true if they are non-empty, and to false otherwise Dates are converted to true if they are not zero, and to false otherwise Arrays are always converted to true (even if empty) Objects / HtmlNodes / Binary are always converted to true @param {Any} value - Input value of arbitrary type. @return {Boolean} - The appropriate boolean value.
func ToDateTime ¶
TO_DATETIME takes an input value of any type and converts it into the appropriate date time value. @param {Any} value - Input value of arbitrary type. @return {DateTime} - Parsed date time.
func ToFloat ¶
TO_FLOAT takes an input value of any type and convert it into a float value. None and false are converted to the value 0 true is converted to 1 Numbers keep their original value Strings are converted to their numeric equivalent if the string contains a valid representation of a number. String values that do not contain any valid representation of a number will be converted to the number 0. An empty array is converted to 0, an array with one member is converted into the result of TO_NUMBER() for its sole member. An array with two or more members is converted to the number 0. An object / HTML node is converted to the number 0. @param {Any} value - Input value of arbitrary type. @return {Float} - A float value.
func ToInt ¶
TO_INT takes an input value of any type and convert it into an integer value. None and false are converted to the value 0 true is converted to 1 Numbers keep their original value Strings are converted to their numeric equivalent if the string contains a valid representation of a number. String values that do not contain any valid representation of a number will be converted to the number 0. An empty array is converted to 0, an array with one member is converted into the result of TO_NUMBER() for its sole member. An array with two or more members is converted to the number 0. An object / HTML node is converted to the number 0. @param {Any} value - Input value of arbitrary type. @return {Int} - An integer value.
Types ¶
This section is empty.