Skip to content

improved iteration support

Compare
Choose a tag to compare
@tdumitrescu tdumitrescu released this 26 Apr 16:06
· 66 commits to master since this release

Implements the remaining missing features from https://pugjs.org/language/iteration.html:

Iteration over key/value pairs of objects:

each val, key in {foo: 'bar', baz: 'qux'}
  .object-entry Value at #{key} is #{val}

else-block executes when no entries (in array or object) exist:

- var values = [];
ul
  each val in values
    li= val
  else
    li There are no values