Explorer

definy.snapshot-cbor-without-parts

description
The CBOR of an event content with the parts of every module of a project snapshot (#project_commit) replaced by an empty array. Other contents stay as they are
type
Fn(cbor: @cbor.item) -> @cbor.item
expression
fn(cbor$0) =>
  match $0 {
    #map(entries$1) =>
      #map<@cbor.item>(@core.list-map(
        T: @cbor.entry,
        U: @cbor.entry,
        f: fn(item$2) =>
          match @core.equal(left: @cbor.key-string(key: $2.key), right: "#project_commit") {
            false =>
              $2,
            true =>
              match $2.value {
                #map(fields$3) =>
                  {
                    key: $2.key,
                    value: #map<@cbor.item>(@core.list-map(
                      T: @cbor.entry,
                      U: @cbor.entry,
                      f: fn(item$4) =>
                        match @core.equal(left: @cbor.key-string(key: $4.key), right: "modules") {
                          false =>
                            $4,
                          true =>
                            match $4.value {
                              #array(modules$5) =>
                                {
                                  key: $4.key,
                                  value: #array<@cbor.item>(@core.list-map(
                                    T: @cbor.item,
                                    U: @cbor.item,
                                    f: fn(item$6) =>
                                      match $6 {
                                        #map(module_fields$7) =>
                                          #map<@cbor.item>(@core.list-map(
                                            T: @cbor.entry,
                                            U: @cbor.entry,
                                            f: fn(item$8) =>
                                              match @core.equal(left: @cbor.key-string(key: $8.key), right: "parts") {
                                                false =>
                                                  $8,
                                                true =>
                                                  {key: $8.key, value: #array<@cbor.item>([])}
                                              },
                                            xs: $7
                                          )),
                                        _ =>
                                          $6
                                      },
                                    xs: $5
                                  ))
                                },
                              _ =>
                                $4
                            }
                        },
                      xs: $3
                    ))
                  },
                _ =>
                  $2
              }
          },
        xs: $1
      )),
    _ =>
      $0
  }
visibility
public
definy.snapshot-cbor-without-parts (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: IvGEftDU40IhdIZogQdIedziG-dNA4aJ-Qxl04nDIXo
content hash: qAwZkOoSUXBxdEcIaowp8gxRqJE8-ZPUaSV2QxWiiM8