function sortBy(getterFn) {
  return (a, b) => {
    const aVal = getterFn(a)
    const bVal = getterFn(b)
    if (aVal > bVal) {
      return 1
    } else if (aVal < bVal) {
      return -1
    } else {
      return 0
    }
  }
}
@template T
@template U
@param {(value: T) => U} getterFn
@returns {(a: T, b: T) => 1 | -1 | 0}