From cf878ca4102ffaf440e050da662dbfd1d47e7cde Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 3 Feb 2020 18:22:59 +0000 Subject: [PATCH] =?UTF-8?q?Use=20Object.keys()=20not=20Python=20{}.keys()?= =?UTF-8?q?=20=F0=9F=A4=A6=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/services/osmose.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/services/osmose.js b/modules/services/osmose.js index d289e1d85..b48e9e6ac 100644 --- a/modules/services/osmose.js +++ b/modules/services/osmose.js @@ -13,9 +13,9 @@ const tiler = utilTiler(); const dispatch = d3_dispatch('loaded'); const _osmoseUrlRoot = 'https://osmose.openstreetmap.fr/en/api/0.3beta'; const _osmoseItems = - qaServices.osmose.errorIcons.keys() - .map(s => s.split('-')[0]) - .reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []); + Object.keys(qaServices.osmose.errorIcons) + .map(s => s.split('-')[0]) + .reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []); const _erZoom = 14; const _stringCache = {}; @@ -186,11 +186,11 @@ export default { }, loadStrings(callback, locale=currentLocale) { - const issueTypes = qaServices.osmose.errorIcons.keys(); + const issueTypes = Object.keys(qaServices.osmose.errorIcons); if ( locale in _stringCache - && _stringCache[locale].keys().length === issueTypes.length + && Object.keys(_stringCache[locale]).length === issueTypes.length ) { if (callback) callback(null, _stringCache[locale]); return;