Skip to content

Commit be99700

Browse files
committed
updated docs
1 parent d9895c1 commit be99700

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

docs/4.syntax/2.pipes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The `empty` filter checks if the variable is empty and returns a boolean. A vari
3636
- It's considered `false` in JavaScript (the value is `false`, an empty string, `0`, `null`, `undefined`, etc)
3737
- It's a string only with spaces (For example `" \t\n"`)
3838
- I'ts an empty array (`[]`)
39+
- I'ts an empty plain object (`{}`)
3940

4041
This filter is useful for conditions:
4142

@@ -45,6 +46,14 @@ No tags defined
4546
{{ /if }}
4647
```
4748

49+
Use exclamation mark to check if a value is not empty:
50+
51+
```vto
52+
{{ if tags |> !empty }}
53+
There are tags
54+
{{ /if }}
55+
```
56+
4857
The `safe` filter does not transform the content, but can be used to mark HTML
4958
data as trusted when in autoescaping mode;
5059

0 commit comments

Comments
 (0)