lib/avltree.js
function compare(tree_key, key) {
  let buf

  if (Buffer.isBuffer(key)) {
    buf = key
  } else if (typeof key == 'string') {
    buf = Buffer.from(key)
  } else {
    throw new TypeError('Argument `key` must be a Buffer or a string')
  }

  return Buffer.compare(tree_key, buf)
}
function compare(tree_key, key) {
  let buf

  if (Buffer.isBuffer(key)) {
    buf = key
  } else if (typeof key == 'string') {
    buf = Buffer.from(key)
  } else {
    throw new TypeError('Argument `key` must be a Buffer or a string')
  }

  return Buffer.compare(tree_key, buf)
}
function compare ( tree_key , key ) { let buf if ( Buffer . isBuffer ( key ) ) { buf = key } else if ( typeof key == 'string' ) { buf = Buffer . from ( key ) } else { throw new TypeError ( 'Argument `key` must be a Buffer or a string' ) } return Buffer . compare ( tree_key , buf ) }
compare 2 keys
@param tree_key {Buffer}
@param key {string|Buffer}
@returns {number}
compare 2 keys