const useSortedBoundaries = function useSortedBoundaries(boundaries, compare) {
  if (!compare) return boundaries;
  return boundaries.slice().sort((a, b) => {
    const value = compare(a.properties, b.properties);
    if (value !== 0) return value;
    return a.properties.code.localeCompare(b.properties.code);
  });
};
export default useSortedBoundaries;