IS_ARRAY
SourceIS_ARRAY checks whether value is an array value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is array, otherwise false.
IS_BINARY
SourceIS_BINARY checks whether value is a binary value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is binary, otherwise false.
IS_BOOL
SourceIS_BOOL checks whether value is a boolean value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is boolean, otherwise false.
IS_DATETIME
SourceIS_DATETIME checks whether value is a date time value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is date time, otherwise false.
IS_DURATION
SourceIS_DURATION checks whether value is a native duration value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is a duration, otherwise false.
IS_FLOAT
SourceIS_FLOAT checks whether value is a float value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is float, otherwise false.
IS_HTML_DOCUMENT
SourceIS_HTML_DOCUMENT checks whether value is a HTMLDocument value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is htmldocument, otherwise false.
IS_HTML_ELEMENT
SourceIS_HTML_ELEMENT checks whether value is a HTMLElement value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is htmlelement, otherwise false.
IS_INT
SourceIS_INT checks whether value is a int value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is int, otherwise false.
IS_LIST
SourceIS_LIST checks whether value is a list value. This is an alias for IS_ARRAY.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is list, otherwise false.
IS_MAP
SourceIS_MAP checks whether value is a map value. This is an alias for IS_OBJECT.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is map, otherwise false.
IS_NAN
SourceIS_NAN checks whether value is NaN.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is nan, otherwise false.
IS_NONE
SourceIS_NONE checks whether value is a none value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is none, otherwise false.
IS_OBJECT
SourceIS_OBJECT checks whether value is an object value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is object, otherwise false.
IS_STRING
SourceIS_STRING checks whether value is a string value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean Returns true if value is string, otherwise false.
TO_ARRAY
SourceTO_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.
| Argument | Type | Default value | Description |
input |
Any |
Input value of arbitrary type. |
Returns Any[] An array value.
TO_BINARY
SourceTO_BINARY takes an input value of any type and converts it into a binary value. The value is first converted to its string representation, then the string bytes are used as the binary content.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Binary A binary value.
TO_BOOL
SourceTO_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
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Boolean The appropriate boolean value.
TO_DATETIME
SourceTO_DATETIME returns an existing DateTime or parses an RFC3339 string. With an explicit unit, it also converts an Int or finite Float offset from the Unix epoch. Supported units are s, ms, us, and ns; aliases include sec, second, seconds, millisecond, milliseconds, µs, μs, microsecond, microseconds, nanosecond, and nanoseconds. Unit matching is case-insensitive.
Numeric values always require a unit; Ferret never guesses from their magnitude. Negative epochs and fractional values are supported, and fractions smaller than one nanosecond are truncated toward zero. Numeric strings are not epoch values. Unknown units, non-finite numbers, and values outside the DateTime range raise runtime errors. A unit supplied with a DateTime or RFC3339 string is also an error.
| Argument | Type | Default value | Description |
value |
DateTime, String, Int, Float |
Existing DateTime, RFC3339 string, or numeric Unix epoch offset. | |
unit |
String |
Optional epoch unit for numeric values: s, ms, us, or ns. |
Returns DateTime Parsed date time.
TO_DURATION
SourceTO_DURATION converts a value to a native Duration. Numeric values are milliseconds, duration strings may use compound syntax, and fractional nanoseconds are truncated toward zero.
| Argument | Type | Default value | Description |
value |
Any |
Value supported by the canonical Duration conversion rules. |
Returns Duration Converted duration value.
TO_FLOAT
SourceTO_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.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Float A float value.
TO_INT
SourceTO_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.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Int An integer value.
TO_OBJECT
SourceTO_OBJECT converts the given value to an object. The conversion rules depend on the input type.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns Object The object representation of the given value.
TO_STRING
SourceTO_STRING takes an input value of any type and convert it into a string value.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns String String representation of a given value.
TYPENAME
TYPENAME returns the data type name of a value as a string.
| Argument | Type | Default value | Description |
value |
Any |
Input value of arbitrary type. |
Returns String Returns string representation of a type (e.g. "Int", "Float", "Duration", "String", "Array", "Object", "DateTime", "Boolean", "Binary", "None").