47 lines
1006 B
JSON
47 lines
1006 B
JSON
{
|
|
"expression": ["index-of", ["get", "i"], ["get", "arr"]],
|
|
"inputs": [
|
|
[{}, {"properties": {"i": null, "arr": [9, 8, 7]}}],
|
|
[{}, {"properties": {"i": 1, "arr": [9, 8, 7]}}],
|
|
[{}, {"properties": {"i": 9, "arr": [9, 8, 7]}}],
|
|
[
|
|
{},
|
|
{
|
|
"properties": {
|
|
"i": "foo",
|
|
"arr": ["baz", "bar", "hello", "foo", "world"]
|
|
}
|
|
}
|
|
],
|
|
[
|
|
{},
|
|
{
|
|
"properties": {
|
|
"i": true,
|
|
"arr": ["foo", 123, null, 456, false, {}, true]
|
|
}
|
|
}
|
|
],
|
|
[{}, {"properties": {"i": 1, "arr": null}}]
|
|
],
|
|
"expected": {
|
|
"compiled": {
|
|
"result": "success",
|
|
"isFeatureConstant": false,
|
|
"isZoomConstant": true,
|
|
"type": "number"
|
|
},
|
|
"serialized": ["index-of", ["get", "i"], ["get", "arr"]],
|
|
"outputs": [
|
|
-1,
|
|
-1,
|
|
0,
|
|
3,
|
|
6,
|
|
{
|
|
"error": "Expected second argument to be of type array or string, but found null instead."
|
|
}
|
|
]
|
|
}
|
|
}
|