```python

def field_of(record: dict, field: str) -> int:
    if field not in record:
        raise ValueError("Record does not contain the specified field")
    return record[field]

def sort_pairs(records: list, field: str) -> list:
    return sorted(records, key=lambda x: x[field])
```