Files
MapLibreParticleLab/metrics/integration/expression-tests/slice/array-one-index/test.json
Siarhei Fedartsou 09f17c0fc4 Implement slice expression (#1133)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2023-08-26 18:32:45 +02:00

19 lines
674 B
JSON

{
"expression": ["slice", ["array", ["get", "val"]], ["get", "index"]],
"inputs": [
[{}, {"properties": {"val": [1, 2, 3, 4, 5], "index": 2}}],
[{}, {"properties": {"val": [1, 2, 3, 4, 5], "index": 0}}],
[{}, {"properties": {"val": [1, 2, 3, 4, 5], "index": 99}}],
[{}, {"properties": {"val": [1, 2, 3, 4, 5], "index": -2}}]
],
"expected": {
"serialized": ["slice", ["array", ["get", "val"]], ["get", "index"]],
"compiled": {
"result": "success",
"isFeatureConstant": false,
"isZoomConstant": true,
"type": "array"
},
"outputs": [[3, 4, 5], [1, 2, 3, 4, 5], [], [4, 5]]
}
}