Explorer

definy.event-snapshot-find

description
The snapshot of the event hash from index
type
Fn(commits: List<@definy.event-snapshot>, event_hash: String, index: Number) -> Union{#none, #some(@definy.event-snapshot)}
expression
fn(commits$0, event_hash$1, index$2) =>
  match @core.list-get(list: $0, index: $2) {
    #some(commit$3) =>
      match @core.equal(left: $3.event_hash, right: $1) {
        true =>
          #some($3),
        false =>
          @definy.event-snapshot-find(commits: $0, event_hash: $1, index: @core.plus(left: $2, right: 1))
      },
    #none(_) =>
      #none
  }
visibility
public
definy.event-snapshot-find (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: odsHZpPqicNZAvkuhgAxCJFsQZxpFoB2kAmR2vEHQ_w
content hash: f8NfsyNBFf12NsUR6YfXGudKmC93lpjfqaWS6VQvxZo