google / go-jsonnet

Apache License 2.0
1.63k stars 235 forks source link

Add support for negative array indexes #777

Open ricardbejarano opened 4 weeks ago

ricardbejarano commented 4 weeks ago

This enables reverse indexing of array values by using negative indexes.

Before:

> local a = [1,2,3];
> a[std.length(a)-1]
3

After:

> [1,2,3][-1]
3