Type
| Information | |
|---|---|
| Type | Data Function |
| Namespace | moxlib:api/helpers/data/type |
| Versions | 1.15+ |
Overview
Returns the Type of the given data.
Example
data modify storage moxlib:api/helpers/data/type target set value ["hello","world"]
function moxlib:api/helpers/data/type
Output of storage moxlib:api/helpers/data/type
{
output: "array"
}
API
Expects
- Any
target
Returns
- String
output
| target | output |
|---|---|
| {a:1,b:2} | "object" |
| ["a","b"] | "array" |
| "hello" | "string" |
| '{"text":"hello"}' | "json"* |
| 12b | "byte" |
| 132s | "short" |
| 420 | "integer" |
| 487l | "long" |
| 43.48f | "float" |
| 684.38d | "double" |
*JSON input must be a valid Raw JSON Text component to be detected.