Explorer

core.value-to-module-snapshot-part

description
Read a value of the evaluator (core.value) as core.module-snapshot-part. none if the shape differs (generated by scripts/generate_value_decoders.ts)
type
Fn(value: @core.value) -> Union{#none, #some(@core.module-snapshot-part)}
expression
fn(value$0) =>
  match $0 {
    #record(fields$1) =>
      match @core.value-record-field(fields: $1, key: "name", index: 0) {
        #some(field$2) =>
          match @core.value-decoded(
              T: String,
              decoded: match $2 {
                #string(v$4) =>
                  #some($4),
                _ =>
                  #none
              }
            ) {
            #some(name$3) =>
              match @core.value-record-field(fields: $1, key: "content_hash", index: 0) {
                #some(field$5) =>
                  match @core.value-decoded(
                      T: String,
                      decoded: match $5 {
                        #string(v$7) =>
                          #some($7),
                        _ =>
                          #none
                      }
                    ) {
                    #some(content_hash$6) =>
                      #some({name: $3, content_hash: $6}),
                    _ =>
                      #none
                  },
                _ =>
                  #none
              },
            _ =>
              #none
          },
        _ =>
          #none
      },
    _ =>
      #none
  }
visibility
public
core.value-to-module-snapshot-part (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: WrX2sLKMv4ZvBtMA0c1wfPpgmINQcJMDVuk9miZiN2M
content hash: kDmfG5J2rFQ5GXvGzCcqJoottuYPO-Z4UFsKvYLIHlI