kind
Function
kind — return a value’s type category
Synopsis
kind(val: any) -> string
Description
The kind function returns the category of the type of v
as a string,
e.g., “record”, “set”, “primitive”, etc. If v
is a type value,
then the type category of the referenced type is returned.
Example:
A primitive value’s kind is “primitive”:
values kind(this)
1
"a"
10.0.0.1
Loading...
echo '1
"a"
10.0.0.1' \
| super -s -c 'values kind(this)' -
A complex value’s kind is its complex type category. Try it on these empty values of various complex types:
values kind(this)
{}
[]
|[]|
|{}|
1::(int64|string)
Loading...
echo '{}
[]
|[]|
|{}|
1::(int64|string)' \
| super -s -c 'values kind(this)' -
An error has kind “error”:
values kind(1/this)
0
Loading...
echo '0' \
| super -s -c 'values kind(1/this)' -
A type’s kind is the kind of the type:
values kind(this)
<{s:string}>
Loading...
echo '<{s:string}>' \
| super -s -c 'values kind(this)' -