def redirect.dots.up

emerging-ezhttp@0.21.0.0 · src/redirect.bend:56

import emerging-ezhttp@0.21.0.0/src/redirect.bend as Redirect
import Base

56# a segment that is not `.`: `..` drops the last kept, any other is kept
57def redirect.dots.up(up: Bool, last: Bool, s: String, out: List<&2, String>,
58  rest: List<&2, String> -> List<&2, String>) -> List<&2, String>:
59  match up:
60    case True{}:
61      rest(redirect.dots.end(last, redirect.pop(out)))
62    case False{}:
63      rest(s <> out)

Uses (5)

Used by (1)