Explorer

definy.json-wasi-io-parts

description
(en) Read the parts of RunService/RunIo ([{id, cbor}], the expression as Base64 CBOR). An item without the fields has empty strings
type
Fn(items: List<@definy.json>) -> List<@definy.wasi-io-part>
expression
fn(items$0) =>
  @core.list-map(
    T: @definy.json,
    U: @definy.wasi-io-part,
    f: fn(item$1) =>
      {
        id: match @definy.json-get-string(value: $1, key: "id") {
          #some(id$2) =>
            $2,
          #none(_) =>
            ""
        },
        cbor: match @definy.json-get-string(value: $1, key: "cbor") {
          #some(cbor$3) =>
            $3,
          #none(_) =>
            ""
        }
      },
    xs: $0
  )
visibility
public
definy.json-wasi-io-parts (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: _pEdJWfCL1XJARDVevmFCgUKxJI0ijF8CIe7_iim54U
content hash: 73-OkiJ_8p5RHCVmPVH7SsjDG7TeP1z3B5_G1PR5iLg