Skip to content

Commit

Permalink
Switches to areaSort (patch)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Jun 6, 2018
1 parent d4e0193 commit d85d81d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/repack-air-quality-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const replaceLetters = data => {
return data
}

function municipalitySort (a, b) {
function areaSort (a, b) {
let num = 0
if (a.municipality < b.municipality) {
if (a.area < b.area) {
num = -1
}
if (a.municipality > b.municipality) {
if (a.area > b.area) {
num = 1
}
return num
Expand Down Expand Up @@ -87,9 +87,9 @@ exports.byMunicipalities = data => {
const stationAggregatedColor = byStationAggregatedColor(station)
const municipality = byMunicipality(stationAggregatedColor)
const municipalityAggregatedColor = byMunicipalityAggregatedColor(municipality)
const municipalities = Object.values(municipalityAggregatedColor)
municipalities.sort(municipalitySort)
return municipalities
const areas = Object.values(municipalityAggregatedColor)
areas.sort(areaSort)
return areas
}

exports.byStations = data => {
Expand Down

0 comments on commit d85d81d

Please sign in to comment.