mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-15 14:42:16 +03:00
Fix import path
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
/*jshint esversion: 6 */
|
/*jshint esversion: 6 */
|
||||||
|
|
||||||
const { UAParser } = require('../main/ua-parser');
|
const { UAParser } = require('../main/ua-parser');
|
||||||
|
const { EngineName } = require('../enums/ua-parser-enums');
|
||||||
const { isStandalonePWA } = require('is-standalone-pwa');
|
const { isStandalonePWA } = require('is-standalone-pwa');
|
||||||
const { isFromEU } = require('detect-europe-js');
|
const { isFromEU } = require('detect-europe-js');
|
||||||
|
|
||||||
@@ -17,7 +18,8 @@ const isChromeFamily = val => !!(
|
|||||||
val.engine
|
val.engine
|
||||||
)?.is(EngineName.BLINK));
|
)?.is(EngineName.BLINK));
|
||||||
|
|
||||||
const isElectron = () => !!(process?.versions?.hasOwnProperty('electron') || // node.js
|
const isElectron = () => !!(
|
||||||
|
process?.versions?.hasOwnProperty('electron') || // node.js
|
||||||
/ electron\//i.test(navigator?.userAgent)); // browser
|
/ electron\//i.test(navigator?.userAgent)); // browser
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe('Extensions', () => {
|
|||||||
['Vehicles', 'vehicle', Vehicles]
|
['Vehicles', 'vehicle', Vehicles]
|
||||||
]
|
]
|
||||||
.forEach(([desc, path, ext]) => {
|
.forEach(([desc, path, ext]) => {
|
||||||
const tests = require(`../data/ua/extension/${path}.json`);
|
const tests = require(`../../data/ua/extension/${path}.json`);
|
||||||
describe(desc, () => {
|
describe(desc, () => {
|
||||||
tests.forEach((test) => {
|
tests.forEach((test) => {
|
||||||
it(`Can detect ${test.desc}: "${test.ua}"`, () => {
|
it(`Can detect ${test.desc}: "${test.ua}"`, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user