Skip to content

Commit

Permalink
Merge pull request #41 from yola/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies.
  • Loading branch information
aleksuk authored Oct 21, 2024
2 parents dd79ac5 + 1695223 commit d088464
Show file tree
Hide file tree
Showing 44 changed files with 13,371 additions and 10,437 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.21.3
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.1

- update `bowser` to 2.11.0 version

## 1.2.0

- add `isChromeOS` os-util
Expand Down Expand Up @@ -25,6 +29,7 @@
Initial release with following API

Browser flags:

- `chrome`
- `firefox`
- `edge`
Expand All @@ -33,6 +38,7 @@ Browser flags:
- `safari`

OS flags:

- `android`
- `ios`
- `iPadOS`
Expand All @@ -41,6 +47,7 @@ OS flags:
- `windows`

Platform flags:

- `mobile`
- `tablet`
- `desktop`
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
moduleDirectories: ['node_modules', './'],
collectCoverageFrom: ['src/**/*.js', '!**/node_modules/**'],
testEnvironment: 'jsdom',
};
23,591 changes: 13,249 additions & 10,342 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "yola-bowser",
"version": "1.2.0",
"version": "1.2.1",
"description": "Wrapper for bowser library with a custom API",
"main": "dist/index.js",
"scripts": {
"build": "webpack --config ./webpack.config.js --mode production",
"dev:watch": "webpack-dev-server --config ./webpack.sandbox.config.js",
"lint": "eslint ./src ./sandbox/src",
"lint": "eslint ./src ./sandbox",
"test": "jest --coverage",
"test:watch": "jest --watch",
"prepublishOnly": "NODE_ENV=production npm run build"
"prepublishOnly": "NODE_ENV=production npm run build",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand All @@ -19,25 +20,25 @@
"license": "UNLICENSED",
"homepage": "https://https://github.com/yola/yola-bowser#readme",
"dependencies": {
"bowser": "^2.7.0"
"bowser": "^2.11.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0",
"eslint": "^4.18.0",
"eslint-plugin-yola": "^1.0.3",
"husky": "^0.14.3",
"jest": "^23.4.1",
"jest-cli": "^23.4.1",
"lint-staged": "^7.0.0",
"prettier": "^1.18.2",
"source-map-loader": "^0.2.3",
"webpack": "^4.20.0",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.14"
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"babel-jest": "^29.7.0",
"babel-loader": "^8.4.1",
"eslint": "^8.57.1",
"eslint-plugin-yola": "^2.1.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^12.5.0",
"prettier": "^3.0.0",
"source-map-loader": "^5.0.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-chrome.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isChrome = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.CHROME;
}
};

export default isChrome;
4 changes: 2 additions & 2 deletions src/browser-utils/is-chrome.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isChrome from './is-chrome';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isChrome', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-chromium.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isChromium = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.CHROMIUM;
}
};

export default isChromium;
4 changes: 2 additions & 2 deletions src/browser-utils/is-chromium.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isChromium from './is-chromium';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isChromium', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-edge.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isEdge = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.EDGE;
}
};

export default isEdge;
4 changes: 2 additions & 2 deletions src/browser-utils/is-edge.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isEdge from './is-edge';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isEdge', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-firefox.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isFirefox = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.FIREFOX;
}
};

export default isFirefox;
4 changes: 2 additions & 2 deletions src/browser-utils/is-firefox.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isFirefox from './is-firefox';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isFirefox', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-ie.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isIE = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.IE;
}
};

export default isIE;
4 changes: 2 additions & 2 deletions src/browser-utils/is-ie.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isIE from './is-ie';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isIE', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-opera.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isOpera = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.OPERA;
}
};

export default isOpera;
4 changes: 2 additions & 2 deletions src/browser-utils/is-opera.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isOpera from './is-opera';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isOpera', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/browser-utils/is-safari.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';

const isSafari = (parser) => {
const browserType = parser.getBrowserName();
return browserType === browserTypes.SAFARI;
}
};

export default isSafari;
4 changes: 2 additions & 2 deletions src/browser-utils/is-safari.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import browserTypes from '../constants/browser-types'
import browserTypes from '../constants/browser-types';
import isSafari from './is-safari';

const getParserMock = (browserName) => ({
getBrowserName: jest.fn(() => browserName)
getBrowserName: jest.fn(() => browserName),
});

describe('isSafari', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/constants/platform-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
export default {
MOBILE: 'mobile',
TABLET: 'tablet',
DESKTOP: 'desktop'
DESKTOP: 'desktop',
};
2 changes: 1 addition & 1 deletion src/general-utils/get-version.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import getVersion from './get-version.js';

const getParserMock = () => ({
getOSVersion: jest.fn(() => 12)
getOSVersion: jest.fn(() => 12),
});

describe('getVersion', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/general-utils/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import getVersion from './get-version';
import isSatisfied from './is-satisfied'
import isSatisfied from './is-satisfied';

export default {
getVersion,
isSatisfied
}
isSatisfied,
};
2 changes: 1 addition & 1 deletion src/general-utils/is-satisfied.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isSatisfied from './is-satisfied';

const getParserMock = () => ({
satisfies: jest.fn((params) => params)
satisfies: jest.fn((params) => params),
});

describe('isSatisfied', () => {
Expand Down
17 changes: 14 additions & 3 deletions src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const getBowserMock = ({ browser, os, platform, version }) => ({
getOSName: jest.fn(() => os),
getPlatformType: jest.fn(() => platform),
getOSVersion: jest.fn(() => version),
}))
})),
});

const setup = ({ browser, os, platform, version }) => {
Expand All @@ -22,12 +22,23 @@ const setup = ({ browser, os, platform, version }) => {
const setMaxTouchPoints = (n) => {
Object.defineProperty(global.navigator, 'maxTouchPoints', {
configurable: true,
get: jest.fn().mockImplementation(() => n)
get: jest.fn().mockImplementation(() => n),
});
};

describe('yola-bowser: ', () => {
let yolaBowser;
let globalNavigator;

beforeAll(() => {
globalNavigator = global.navigator;

global.navigator = {};
});

afterAll(() => {
global.navigator = globalNavigator;
});

beforeEach(() => {
jest.resetModules();
Expand Down Expand Up @@ -172,5 +183,5 @@ describe('yola-bowser: ', () => {
expect(yolaBowser.version).toEqual('12.2.1');
});
});
})
});
});
2 changes: 1 addition & 1 deletion src/os-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export default {
isLinux,
isMacOS,
isWindows,
isChromeOS
isChromeOS,
};
4 changes: 2 additions & 2 deletions src/os-utils/is-android.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import osTypes from '../constants/os-types'
import osTypes from '../constants/os-types';

const isAndroid = (parser) => {
const osType = parser.getOSName();
return osType === osTypes.ANDROID;
}
};

export default isAndroid;
4 changes: 2 additions & 2 deletions src/os-utils/is-android.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import osTypes from '../constants/os-types'
import osTypes from '../constants/os-types';
import isAndroid from './is-android';

const getParserMock = (osName) => ({
getOSName: jest.fn(() => osName)
getOSName: jest.fn(() => osName),
});

describe('isAndroid', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/os-utils/is-ios.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import osTypes from '../constants/os-types'
import osTypes from '../constants/os-types';

const isIOS = (parser) => {
const osType = parser.getOSName();
return osType === osTypes.IOS;
}
};

export default isIOS;
4 changes: 2 additions & 2 deletions src/os-utils/is-ios.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import osTypes from '../constants/os-types'
import osTypes from '../constants/os-types';
import isIOS from './is-ios';

const getParserMock = (osName) => ({
getOSName: jest.fn(() => osName)
getOSName: jest.fn(() => osName),
});

describe('isIOS', () => {
Expand Down
Loading

0 comments on commit d088464

Please sign in to comment.