Home

cuesonnet @main - refs - log -
-
https://git.jolheiser.com/cuesonnet.git
CUE + Jsonnet
cuesonnet / testdata / jsonnet / conditionals / data.jsonnet
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
local classify = function(n)
  if n < 10 then 'small'
  else if n < 100 then 'medium'
  else 'large';

local nums = [3, 42, 150];

[
  {
    value: n,
    category: classify(n),
    doubled: n * 2,
  }
  for n in nums
]