Explorer

definy.part-referrers

description
The parts other than the part id whose type or expression references the part id
type
Fn(parts: List<@definy.snapshot-check-part>, id: String) -> List<@definy.snapshot-check-part>
expression
fn(parts$0, id$1) =>
  @core.list-fold(
    T: @definy.snapshot-check-part,
    A: List<@definy.snapshot-check-part>,
    reducer: fn(acc$2, item$3) =>
      match @core.equal(left: $3.id, right: $1) {
        true =>
          $2,
        false =>
          match $3.content {
            #some(content$4) =>
              match @core.list-contains-string(
                  list: @core.expression-part-references-in-list(items: @definy.part-content-expressions(content: $4), index: 0, ids: []),
                  target: $1,
                  index: 0
                ) {
                true =>
                  @core.list-append(list: $2, item: $3),
                false =>
                  $2
              },
            #none(_) =>
              $2
          }
      },
    init: [],
    xs: $0
  )
visibility
public
definy.part-referrers (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: 8o8znVmH8GCewousVX-sKJJhQpyhKktXOH26goEt6gA
content hash: 4OZYgk-d5mKrlFGJfocuKcz7mtr_ibFV_t1m_7V8BtM