Skip to content

Commit

Permalink
Updated support note in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Kanodia committed Feb 8, 2022
1 parent 47049a5 commit ea9e427
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 18 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
363 changes: 363 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ matchesUA(
- Safari Desktop as `Safari`
- IE as `ie` | `ie_mob`
- Edge as `Edge`
- OperaMobile as `OperaMobile`
- Electron as `Electron`

PRs to add more _browserslist supported_ browsers are welcome 👋

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function resolveUserAgent(uaString) {
}

if (parsedUA.family === 'Electron') {
const electronVersion = [ parsedUA.major, parsedUA.minor ].join('.')
const electronVersion = [parsedUA.major, parsedUA.minor].join('.')
return {
family: 'Chrome',
version: e2c[electronVersion],
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"build": "mkdir -p lib && babel index.js --out-file lib/index.js"
},
"dependencies": {
"browserslist": "^4.12.0",
"electron-to-chromium": "^1.3.815",
"browserslist": "^4.19.1",
"electron-to-chromium": "^1.4.67",
"useragent": "^2.3.0"
},
"devDependencies": {
Expand All @@ -32,7 +32,7 @@
"babel-preset-stage-2": "^6.24.1",
"jest": "^23.6.0",
"prettier": "^2.5.1",
"useragent-generator": "^1.1.0"
"useragent-generator": "^1.1.1-amkt-22079-finish.0"
},
"jest": {
"projects": [
Expand Down
11 changes: 5 additions & 6 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CustomUserAgentString = {
'Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12D508 [FBAN/FBIOS;FBAV/27.0.0.10.12;FBBV/8291884;FBDV/iPhone7,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/8.2;FBSS/3; FBCR/vodafoneIE;FBID/phone;FBLC/en_US;FBOP/5]',
OPERA_MOBILE:
'Opera/9.80 (Android 2.3.3; Linux; Opera Mobi/ADR-1111101157; U; es-ES) Presto/2.9.201 Version/11.50',
ELECTRON:
ELECTRON:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_4_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Electron/12.0.13 Safari/537.36',
}

Expand Down Expand Up @@ -188,11 +188,10 @@ it('resolves samsung browser properly', () => {

it('resolves electron properly', () => {
// Electron 12 -> Chrome 89
expect(resolveUserAgent(CustomUserAgentString.ELECTRON))
.toEqual({
family: 'Chrome',
version: '89'
})
expect(resolveUserAgent(CustomUserAgentString.ELECTRON)).toEqual({
family: 'Chrome',
version: '89',
})
})

it('detects if browserslist matches UA', () => {
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1332,11 +1332,11 @@ __metadata:
babel-preset-es2015: ^6.24.1
babel-preset-stage-2: ^6.24.1
browserslist: ^4.19.1
electron-to-chromium: ^1.4.67
jest: ^23.6.0
prettier: ^2.5.1
semver: ^7.3.5
useragent: ^2.3.0
useragent-generator: ^1.1.0
useragent-generator: ^1.1.1-amkt-22079-finish.0
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -1881,7 +1881,7 @@ __metadata:
languageName: node
linkType: hard

"electron-to-chromium@npm:^1.4.17":
"electron-to-chromium@npm:^1.4.17, electron-to-chromium@npm:^1.4.67":
version: 1.4.67
resolution: "electron-to-chromium@npm:1.4.67"
checksum: 687fa3b403504d5ecabac2a0ab59754d59187b8cfca2d5cf34c83eef0791a5d60a4378df84b811d81804c22e8c9dad02c89d9bc03b28fb547cb2bb52e1f7eeb9
Expand Down Expand Up @@ -6039,14 +6039,14 @@ __metadata:
languageName: node
linkType: hard

"useragent-generator@npm:^1.1.0":
version: 1.1.0
resolution: "useragent-generator@npm:1.1.0"
"useragent-generator@npm:^1.1.1-amkt-22079-finish.0":
version: 1.1.1-amkt-22079-finish.1
resolution: "useragent-generator@npm:1.1.1-amkt-22079-finish.1"
dependencies:
normalize-version: ^1.0.5
semver: ^5.4.1
semver-closest: ^0.1.0
checksum: 077a21580125627927032f8ee0ff7f8b640ed4d275b58f6bfa74cc277320226635ddd1a2ccc782c5dba405df0229551498e710068d8b40f99740e72cc36f0e11
checksum: 81ac764f08da0c6f6507e203714e03238afad4c63d0d27cdca85a14d1ff7ebaa6be5eb6ec6683e6c53f5e0c06aba0b70783ec580cbfd0fee8c2a3da27525908c
languageName: node
linkType: hard

Expand Down

0 comments on commit ea9e427

Please sign in to comment.