Explorer

definy.snapshot-part-find

description
The first snapshot from index that has the part named name (module.name), with the part
type
Fn(commits: List<@definy.event-snapshot>, name: String, index: Number) -> Union{#none, #some(Record{commit: @definy.event-snapshot, part: @definy.stored-snapshot-part})}
expression
fn(commits$0, name$1, index$3) =>
  match @core.list-get(list: $0, index: $3) {
    #none(_) =>
      #none,
    #some(commit$4) =>
      match @definy.stored-part-find(parts: @definy.snapshot-parts(modules: $4.commit.modules, index: 0), name: $1, index: 0) {
        #some(part$5) =>
          #some({commit: $4, part: $5}),
        #none(_) =>
          @definy.snapshot-part-find(commits: $0, name: $1, index: @core.plus(left: $3, right: 1))
      }
  }
visibility
public
definy.snapshot-part-find (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: YwQtJXHYK4M4nx3BQmxaAuIyjYL4jzn0bPOfipk1bAc
content hash: AX_YLdAOFbShtOPXcO3Qwhf7bko82mbmhAvQh0AP-sY