add alias for "blankIfNull"
This commit is contained in:
parent
1595d54041
commit
fdcd0d74d3
|
@ -13,7 +13,8 @@
|
|||
(defonce standard-functions
|
||||
{"blankIfNull"
|
||||
{:fn (fn [x]
|
||||
(if (nil? x) "" x))}
|
||||
(if (nil? x) "" x))
|
||||
:aliases ["nonull"]}
|
||||
|
||||
"butlast"
|
||||
{:fn (fn [sequence]
|
||||
|
|
|
@ -250,7 +250,9 @@
|
|||
(is (= (render "{{ a|blankIfNull }}" {:a nil})
|
||||
""))
|
||||
(is (= (render "{{ a|blankIfNull }}" {:a "foo"})
|
||||
"foo")))
|
||||
"foo"))
|
||||
(is (= (render "{{ a|nonull }}" nil)
|
||||
"")))
|
||||
|
||||
(testing "butlast"
|
||||
(is (= (render "{{ [1, 2, 3, 4, 5]|butlast }}" nil)
|
||||
|
|
Reference in a new issue