currentBestLogicalPath = (
  logicalPath,
  packageLocation,
  preferredPackageLogicalPathMap,
) => {
  const theCurrentBest = preferredPackageLogicalPathMap.get(packageLocation);
  if (theCurrentBest === undefined) {
    return logicalPath;
  }
  return pathCompare(logicalPath, theCurrentBest) < 0
    ? logicalPath
    : theCurrentBest;
}
Compares `logicalPath` to the current best logical path in `preferredPackageLogicalPathMap` for `packageLocation`.

If no current best path exists, it returns `logicalPath`.

@template {string[]} T
@template {string[]} U
@param {T} logicalPath
@param {string} packageLocation
@param {Map<string, U>} preferredPackageLogicalPathMap
@returns {T|U}