~ntietz/hurl-lang

hurl-lang/lib/if.hurl -rw-r--r-- 322 bytes
5c1b4984Nicole Tietz-Sokolskaya name 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let if = func(cond, on_true) {
    try {
        cond();
    } catch (true) {
        on_true();
    } catch as default {
    };
};

let if_else = func(cond, on_true, on_false) {
    try {
        cond();
    } catch (true) {
        on_true();
    } catch (false) {
        on_false();
    } catch as default {
    };
};