From 0f20a43f0a9ba8c7565723eab32270e3e6c5aed2 Mon Sep 17 00:00:00 2001 From: Marco Starker Date: Thu, 18 Apr 2019 13:46:30 +0200 Subject: [PATCH] fixing ES6 Module import for BROWSER_ALIAS_MAP --- src/constants.js | 8 ++------ src/utils.js | 2 +- test/unit/constants.js | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/constants.js b/src/constants.js index dfae9ee..855abab 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,6 @@ // NOTE: this list must be up-to-date with browsers listed in // test/acceptance/useragentstrings.yml -const BROWSER_ALIASES_MAP = { +export default { 'Amazon Silk': 'amazon_silk', 'Android Browser': 'android', Bada: 'bada', @@ -35,8 +35,4 @@ const BROWSER_ALIASES_MAP = { 'WebOS Browser': 'webos', WeChat: 'wechat', 'Yandex Browser': 'yandex', -}; - -module.exports = { - BROWSER_ALIASES_MAP, -}; +} diff --git a/src/utils.js b/src/utils.js index 942c3db..46f2ed5 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,4 +1,4 @@ -import { BROWSER_ALIASES_MAP } from './constants.js'; +import BROWSER_ALIASES_MAP from './constants.js'; export default class Utils { /** diff --git a/test/unit/constants.js b/test/unit/constants.js index a8b2be6..de4a54b 100644 --- a/test/unit/constants.js +++ b/test/unit/constants.js @@ -1,5 +1,5 @@ import test from 'ava'; -import { BROWSER_ALIASES_MAP } from '../../src/constants'; +import BROWSER_ALIASES_MAP from '../../src/constants'; test('check duplicate aliases', (t) => { const aliasesList = Object.keys(BROWSER_ALIASES_MAP).map(value => (BROWSER_ALIASES_MAP[value]));