Skip to content

0.11.6

Compare
Choose a tag to compare
@yurique yurique released this 21 Jan 03:48
· 308 commits to main since this release
  • Bugfix: disjunction
  • Bugfix: .map was not storing the mapped value (in the internal state)

The value of the disjunction was not stored (in the internal state), thus a disjunction would not
match multiple times in a row (even if the resulting values were different).

An example that would show this behavior:

(pathEnd.map(_ => true) | path("page-1").map(_ => false)) { isIndex =>
  render(Page(isIndex))
}
  • API: new combinators for directives
    • .some – transforms a Directive[A] into a Directive[Option[A]] (with Some(_) value)
    • .none – transforms a Directive[A] into a Directive[Option[A]] (with None value)
    • .mapOption – transforms a Directive[Option[A]] into a Directive[Option[B]] (applying the provided function to the Option)