Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stable #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"polygon-lookup": "^2.1.0",
"request": "^2.83.0",
"simplify-js": "^1.2.1",
"stable": "^0.1.8",
"through2": "^3.0.0",
"through2-filter": "^3.0.0",
"through2-map": "^3.0.0",
Expand Down
3 changes: 1 addition & 2 deletions src/postalCityMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const stable = require('stable');
const csv = require('csv-parse/lib/sync');
const config = require('pelias-config').generate();
const logger = require('pelias-logger').get('wof-admin-lookup');
Expand Down Expand Up @@ -111,7 +110,7 @@ function loadTable(cc){
});

// re-sort the records by weight DESC in case they were provided out-of-order
m[postalcode] = stable(m[postalcode], (a, b) => b.weight - a.weight);
m[postalcode].sort((a, b) => b.weight - a.weight);

// remove duplicate WOFID entries (favour the higher weighted duplicate)
m[postalcode] = _.uniqBy(m[postalcode], 'wofid');
Expand Down