Explorer

definy.definition-of-content

description
Read a content of the CAS (Base64) as a part definition: CBOR (cbor.read) of a core.expression (core.value-to-expression checks the shape)
type
Fn(content_bytes: String) -> Union{#none, #some(@core.expression)}
expression
fn(content_bytes$0) =>
  match @std.base64-to-bytes(text: $0) {
    #none(_) =>
      #none,
    #some(bytes$1) =>
      match @cbor.read(bytes: $1, offset: 0) {
        #none(_) =>
          #none,
        #some(item$2) =>
          @core.value-to-expression(value: @definy.cbor-to-value(cbor: $2.value))
      }
  }
visibility
public
definy.definition-of-content (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: RSHSOAVnU9WHMup62AcQPypKsKy-61Ptl0JKMbNEK-o
content hash: I5z2SmW5w6flzYQcm75YVVYhlbe6bUZ_tQRqsKGXlHo