From 0ec904f0c38265575cde71daf6b2bd4b13554302 Mon Sep 17 00:00:00 2001 From: vulpivia Date: Sat, 3 Aug 2024 16:21:16 +0200 Subject: [PATCH] Remove stable --- package.json | 1 - src/postalCityMap.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index a0a9999..8d8f86b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/postalCityMap.js b/src/postalCityMap.js index c0d39af..0c05fff 100644 --- a/src/postalCityMap.js +++ b/src/postalCityMap.js @@ -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'); @@ -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');