types

package
v2.0.0-alpha.63 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsArray

func IsArray(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_array checks whether value is an array value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is array, otherwise false.

func IsBinary

func IsBinary(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_binary checks whether value is a binary value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is binary, otherwise false.

func IsBool

func IsBool(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_bool checks whether value is a boolean value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is boolean, otherwise false.

func IsDateTime

func IsDateTime(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_datetime checks whether value is a date time value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is date time, otherwise false.

func IsDuration

func IsDuration(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_duration tests whether a value has the Duration type. @param value {Any} Input value of arbitrary type. @return {Boolean} True when the value is a Duration; otherwise false.

func IsFloat

func IsFloat(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_float checks whether value is a float value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is float, otherwise false.

func IsInt

func IsInt(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_int checks whether value is a int value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is int, otherwise false.

func IsList

func IsList(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_list checks whether value is a list value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is list, otherwise false.

func IsMap

func IsMap(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_map checks whether value is a map value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is map, otherwise false.

func IsNaN

func IsNaN(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_nan checks whether value is NaN. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is NaN, otherwise false.

func IsNone

func IsNone(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_none checks whether value is a none value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is none, otherwise false.

func IsObject

func IsObject(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_object checks whether value is an object value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is object, otherwise false.

func IsString

func IsString(_ context.Context, arg runtime.Value) (runtime.Value, error)

is_string checks whether value is a string value. @param value {Any} Input value of arbitrary type. @return {Boolean} Returns true if value is string, otherwise false.

func RegisterLib

func RegisterLib(ns runtime.Namespace)

func ToArray

func ToArray(ctx context.Context, arg runtime.Value) (runtime.Value, error)

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 input {Any} Input value of arbitrary type. @return {Any[]} An array value.

func ToBinary

func ToBinary(_ context.Context, arg runtime.Value) (runtime.Value, error)

ToBinary takes an input value of any type and converts it into a binary value. @param value {Any} Input value of arbitrary type. @return {Binary} A binary value.

func ToBool

func ToBool(_ context.Context, arg runtime.Value) (runtime.Value, error)

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 value {Any} Input value of arbitrary type. @return {Boolean} The appropriate boolean value.

func ToDateTime

func ToDateTime(ctx context.Context, arg runtime.Value) (runtime.Value, error)

to_datetime converts one native DateTime or RFC3339 value. @param value {DateTime|String} A DateTime or RFC3339 string. @return {DateTime} Parsed DateTime.

func ToDuration

func ToDuration(ctx context.Context, arg runtime.Value) (runtime.Value, error)

ToDuration converts a value using the language's broad Duration coercion rules. Numeric values are interpreted as milliseconds; Duration strings, NONE, Booleans, and supported list shapes are also accepted. @param value {Any} A value coercible to Duration. @return {Duration} A native duration value.

func ToFloat

func ToFloat(ctx context.Context, arg runtime.Value) (runtime.Value, error)

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 value {Any} Input value of arbitrary type. @return {Float} A float value.

func ToInt

func ToInt(ctx context.Context, arg runtime.Value) (runtime.Value, error)

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 value {Any} Input value of arbitrary type. @return {Int} An integer value.

func ToNumber

func ToNumber(ctx context.Context, arg runtime.Value) (runtime.Value, error)

to_number takes an input value of any type and convert it into a number value. None and false are converted to the zero float true is converted to 1 float 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 value {Any} Input value of arbitrary type. @return {Int|Float} An integer or float value.

func ToObject

func ToObject(ctx context.Context, arg runtime.Value) (runtime.Value, error)

to_object converts the given value to an object. @param value {Any} Input value of arbitrary type. @return {Map} Returns the object representation of the given value.

func ToString

func ToString(_ context.Context, arg runtime.Value) (runtime.Value, error)

to_string takes an input value of any type and convert it into a string value. @param value {Any} Input value of arbitrary type. @return {String} String representation of a given value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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