code: function outputComparator (aScript, aValue, bScript, bValue) {
    if (typeof aValue !== 'number' || typeof bValue !== 'number') throw new TypeError('Expected values of type Number')
    return aValue - bValue || aScript.compare(bScript)
  }
docs: Transaction output amounts (as 64-bit unsigned integers) are to be sorted in ascending order. In the event of two matching output amounts, the respective output scriptPubKeys (as a byte-array) will be compared lexicographically, in ascending order. If the scriptPubKeys match, the outputs are considered equal.