index.js
function getClosest(pathname, references) {
  var hash = getHash(pathname)
  var base = getPathname(pathname)
  var dictionary = []
  var reference
  var subhash
  var subbase

  for (reference in references) {
    subbase = getPathname(reference)
    subhash = getHash(reference)

    if (getPathname(reference) === base) {
      if (subhash && hash) {
        dictionary.push(subhash)
      }
    } else if (!subhash && !hash) {
      dictionary.push(subbase)
    }
  }

  return propose(hash ? hash : base, dictionary, {threshold: 0.7})
}
function getClosest(pathname, references) {
  var hash = getHash(pathname)
  var base = getPathname(pathname)
  var dictionary = []
  var reference
  var subhash
  var subbase

  for (reference in references) {
    subbase = getPathname(reference)
    subhash = getHash(reference)

    if (getPathname(reference) === base) {
      if (subhash && hash) {
        dictionary.push(subhash)
      }
    } else if (!subhash && !hash) {
      dictionary.push(subbase)
    }
  }

  return propose(hash ? hash : base, dictionary, {threshold: 0.7})
}
Suggest a possible similar reference.