main 98594d0

case.json RawHistoryFolder

1{
2  "case": [
3    {
4      "expr": "case(true, 'first', 'default')",
5      "result": { "kind": "String", "value": "first" }
6    },
7    {
8      "expr": "case(false, 'first', 'default')",
9      "result": { "kind": "String", "value": "default" }
10    },
11    {
12      "expr": "case(true, 'first', false, 'second', 'default')",
13      "result": { "kind": "String", "value": "first" }
14    },
15    {
16      "expr": "case(false, 'first', true, 'second', 'default')",
17      "result": { "kind": "String", "value": "second" }
18    },
19    {
20      "expr": "case(false, 'first', false, 'second', 'default')",
21      "result": { "kind": "String", "value": "default" }
22    },
23    {
24      "expr": "case(1 == 1, 'equal', 'not equal')",
25      "result": { "kind": "String", "value": "equal" }
26    },
27    {
28      "expr": "case(1 == 2, 'equal', 'not equal')",
29      "result": { "kind": "String", "value": "not equal" }
30    },
31    {
32      "expr": "case(github.ref == 'refs/heads/main', 'main', github.event_name == 'pull_request', 'pr', 'other')",
33      "contexts": {
34        "github": {
35          "ref": "refs/heads/main",
36          "event_name": "push"
37        }
38      },
39      "result": { "kind": "String", "value": "main" }
40    },
41    {
42      "expr": "case(github.ref == 'refs/heads/main', 'main', github.event_name == 'pull_request', 'pr', 'other')",
43      "contexts": {
44        "github": {
45          "ref": "refs/heads/develop",
46          "event_name": "pull_request"
47        }
48      },
49      "result": { "kind": "String", "value": "pr" }
50    },
51    {
52      "expr": "case(github.ref == 'refs/heads/main', 'main', github.event_name == 'pull_request', 'pr', 'other')",
53      "contexts": {
54        "github": {
55          "ref": "refs/heads/develop",
56          "event_name": "push"
57        }
58      },
59      "result": { "kind": "String", "value": "other" }
60    },
61    {
62      "expr": "case(true, 123, 456)",
63      "result": { "kind": "Number", "value": 123 }
64    },
65    {
66      "expr": "case(false, 123, 456)",
67      "result": { "kind": "Number", "value": 456 }
68    },
69    {
70      "expr": "case(github.event == 'pull_request', 0, 1)",
71      "contexts": {
72        "github": {
73          "event": "pull_request"
74        }
75      },
76      "result": { "kind": "Number", "value": 0 }
77    },
78    {
79      "expr": "case(false, 0, 1)",
80      "result": { "kind": "Number", "value": 1 }
81    },
82    {
83      "expr": "case(true, false, true)",
84      "result": { "kind": "Boolean", "value": false }
85    },
86    {
87      "expr": "case(false, false, true)",
88      "result": { "kind": "Boolean", "value": true }
89    },
90    {
91      "expr": "case(true, '', 'default')",
92      "result": { "kind": "String", "value": "" }
93    },
94    {
95      "expr": "case(false, 'first', '')",
96      "result": { "kind": "String", "value": "" }
97    },
98    {
99      "expr": "case(true, fromJSON('[1,2,3]'), 'default')",
100      "result": { "kind": "Array", "value": [1, 2, 3] }
101    },
102    {
103      "expr": "case(true, fromJSON('{\"key\":\"value\"}'), 'default')",
104      "result": { "kind": "Object", "value": { "key": "value" } }
105    },
106    {
107      "expr": "case(false, 'first', false, 'second', false, 'third', false, 'fourth', 'default')",
108      "result": { "kind": "String", "value": "default" }
109    },
110    {
111      "expr": "case(false, 'first', false, 'second', true, 'third', false, 'fourth', 'default')",
112      "result": { "kind": "String", "value": "third" }
113    },
114    {
115      "expr": "case('not a boolean', 'first', 'default')",
116      "err": {
117        "kind": "evaluation",
118        "value": "case predicate must evaluate to a boolean value"
119      }
120    },
121    {
122      "expr": "case(1, 'first', 'default')",
123      "err": {
124        "kind": "evaluation",
125        "value": "case predicate must evaluate to a boolean value"
126      }
127    },
128    {
129      "expr": "case(null, 'first', 'default')",
130      "err": {
131        "kind": "evaluation",
132        "value": "case predicate must evaluate to a boolean value"
133      }
134    },
135    {
136      "expr": "case(fromJSON('[]'), 'first', 'default')",
137      "err": {
138        "kind": "evaluation",
139        "value": "case predicate must evaluate to a boolean value"
140      }
141    },
142    {
143      "expr": "case(fromJSON('{}'), 'first', 'default')",
144      "err": {
145        "kind": "evaluation",
146        "value": "case predicate must evaluate to a boolean value"
147      }
148    },
149    {
150      "expr": "case(true, 'first', false, 'second')",
151      "err": {
152        "kind": "parsing",
153        "value": "Even number of parameters supplied, requires an odd number of parameters: 'case'. Located at position 1 within expression: case(true, 'first', false, 'second')"
154      }
155    }
156  ]
157}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 3

↑↓ moveenter openesc close