diff --git a/package.json b/package.json index e05d8a22..ce89f8aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hipo/react-ui-toolkit", - "version": "1.0.0-alpha.5.3.0", + "version": "1.0.0-alpha.5.3.1", "description": "React based UI toolkit.", "main": "dist/index.js", "scripts": { diff --git a/src/core/utils/device/deviceUtils.ts b/src/core/utils/device/deviceUtils.ts index 6059b044..46132b1c 100644 --- a/src/core/utils/device/deviceUtils.ts +++ b/src/core/utils/device/deviceUtils.ts @@ -1,5 +1,7 @@ function isMobileDevice() { - const userAgent = navigator.userAgent || navigator.vendor; + const userAgent = + // eslint-disable-next-line no-negated-condition + typeof navigator !== "undefined" ? navigator.userAgent || navigator.vendor : ""; const devices = [/Android/i, /iPhone/i, /iPad/i]; return devices.some((device) => userAgent.match(device)); diff --git a/src/core/utils/number/numberUtils.ts b/src/core/utils/number/numberUtils.ts index 5ca7c916..4346920b 100644 --- a/src/core/utils/number/numberUtils.ts +++ b/src/core/utils/number/numberUtils.ts @@ -1,6 +1,8 @@ import {FormatNumberOptions, ParseNumberOptions} from "./numberTypes"; -const NAVIGATOR_LANGUAGE = typeof navigator !== "undefined" ? navigator.language : "en-GB"; +const NAVIGATOR_LANGUAGE = + // eslint-disable-next-line no-negated-condition + typeof navigator !== "undefined" ? navigator.language : "en-GB"; function formatNumber(formatNumberOptions: FormatNumberOptions) { const {locale, ...otherOptions} = formatNumberOptions;