Explorer

core.record-literal-has-key

description
Checks whether a record literal has the given key
type
Fn(fields: List<Record{key: String, value: @core.expression}>, key: String, index: Number) -> Boolean
expression
fn(fields$0, key$1, index$2) =>
  match @core.list-get(list: $0, index: $2) {
    #none(_) =>
      false,
    #some(item$1003) =>
      match @core.equal(left: $1003.key, right: $1) {
        true =>
          true,
        false =>
          @core.record-literal-has-key(fields: $0, key: $1, index: @core.plus(left: $2, right: 1))
      }
  }
visibility
public
core.record-literal-has-key (project definy, branch compiled-tests, snapshot i6TqClmqVS9FK8rKOvJ43l6Tevx8pvYJ5-zaQqNwemc)
id: U_-mw3xK1eHlABDLy94AB_h7Dbnw1I9PlzS1rYHZsA0
content hash: aHrTD8xaMJohJW4wQGxSpiZ-w8kQs5PMYyVPQuGIioc