Explorer

definy.stored-snapshot-parts

description
The parts of the module from start to end (exclusive) with their IDs, concatenating halves
type
Fn(
  module: @core.project-snapshot-module,
  module_id: String,
  part_ids: List<String>,
  start: Number,
  end: Number
) -> List<@definy.stored-snapshot-part>
expression
fn(module$0, module_id$1, part_ids$2, start$3, end$4) =>
  let count$5 = @core.minus(left: $4, right: $3);
  match @core.less-than(left: $5, right: 2) {
    true =>
      match @core.equal(left: $5, right: 1) {
        true =>
          match @core.list-get(list: $0.parts, index: $3) {
            #some(part$6) =>
              [
                {
                  id: match @core.list-get(list: $2, index: $3) {
                    #some(id$7) =>
                      $7,
                    #none(_) =>
                      ""
                  },
                  name: @core.string-concat(left: @core.string-concat(left: $0.name, right: "."), right: $6.name),
                  module_name: $0.name,
                  module_id: $1,
                  module_visibility: $0.visibility,
                  content_hash: $6.content_hash
                }
              ],
            #none(_) =>
              []
          },
        false =>
          []
      },
    false =>
      let middle$8 = @core.plus(left: $3, right: @core.divide(left: $5, right: 2));
      @core.list-concat(
        left: @definy.stored-snapshot-parts(module: $0, module_id: $1, part_ids: $2, start: $3, end: $8),
        right: @definy.stored-snapshot-parts(module: $0, module_id: $1, part_ids: $2, start: $8, end: $4)
      )
  }
visibility
public
definy.stored-snapshot-parts (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: _krX5-XF9WG3nyP50-AT2LOQe8VSkN5eT4H0YghNf9E
content hash: yR5sjrfGoTcRh9LBbO6qhZlDRZBAC123VMS7qBtRjCU