Explorer

core.project-has-snapshot

description
Whether the project has a snapshot, from index. With hash (some), whether the snapshot is one of the project
type
Fn(
  commits: List<@core.snapshot-summary>,
  project_name: String,
  hash: Union{#none, #some(String)},
  index: Number
) -> Boolean
expression
fn(commits$0, project_name$1, hash$2, index$3) =>
  match @core.list-get(list: $0, index: $3) {
    #none(_) =>
      false,
    #some(item$1006) =>
      let commit$4 = $1006;
      match @core.and(
          left: @core.equal(left: $4.project_name, right: $1),
          right: match $2 {
            #none(_) =>
              true,
            #some(h$5) =>
              @core.equal(left: $4.event_hash, right: $5)
          }
        ) {
        true =>
          true,
        false =>
          @core.project-has-snapshot(commits: $0, project_name: $1, hash: $2, index: @core.plus(left: $3, right: 1))
      }
  }
visibility
public
core.project-has-snapshot (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: qR6qmqNBKU1FZl37fuTi8ZTZf8ohBMPiht2uCo_XUek
content hash: WlPmjRn5dtIeN-4V9BVD_ksdtezCfQjGg0F1dXMtH4s