Explorer

html-ui.url-decode

description
type
Fn(text: String) -> String
expression
fn(text$0) =>
  @std.bytes-to-string(
    bytes: @core.list-fold(
      T: String,
      A: Record{first: Boolean, bytes: List<Number>},
      reducer: fn(acc$1, item$2) =>
        {
          first: false,
          bytes: @core.list-concat(
            left: $1.bytes,
            right: match $1.first {
              true =>
                @core.string-to-bytes(value: $2),
              false =>
                @html-ui.url-decode-segment(segment: $2)
            }
          )
        },
      init: {first: true, bytes: []},
      xs: @core.string-split(text: @core.string-replace(text: $0, from: "+", to: " "), separator: "%")
    ).bytes
  )
visibility
public
html-ui.url-decode (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: 7cbYgZI2AdSTyW4Q4gF_tOMX_MCmzu-Q0bYoQwHYl9A
content hash: ZWZNRHOxNmO4CpNypqPQ0gnRtmcz_3Mt8vnFp-1BWaM