1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Compare commits

...

167 Commits

Author SHA1 Message Date
Denis Demchenko
8c489bd98b
chore: move the token to secrets 2024-08-12 13:42:09 +03:00
Meir Roth
5bab4ee97d
docs: remove non-existing links in README 2024-04-28 23:42:58 +03:00
Naor Peled
16c9f22546
ci: attempt to resolve merge to master errors (#546) 2024-04-20 14:54:03 +03:00
Naor Peled
327e6f5e51
ci: add release drafter (#545) 2024-04-20 14:35:56 +03:00
pastak
0626bf8c8c
Fix link to doc page on README.md (#543) 2023-12-11 10:37:33 +02:00
Naor Peled
94ab87ec0e
feat(constants): add bot as a platform (#540) (#541)
Co-authored-by: Lucio Martinez <martinezlucio.com@gmail.com>
2023-11-27 16:21:18 +02:00
Amelie
07462efb6a
feat: update types of parser methods (#449) 2023-11-17 21:01:45 +02:00
idmadj
f8fcea59e7
docs: fix getBrowserTypeByAlias docs (#467) 2023-11-17 20:55:43 +02:00
daniol
4481f5aab3
feat: add Nokia Vendor (#448) 2023-11-17 20:54:44 +02:00
James Cleveland
0c7380dbf9
fix: use default export in type definitions (#465) 2023-11-17 20:49:07 +02:00
Mehmet Akif Yücel
bb8f94efcd
feat: add Pale Moon browser support (#495) 2023-11-17 20:47:16 +02:00
Matheus Hahn
29222b2fcf
docs: update Typescript definition file (#500) 2023-11-17 20:46:29 +02:00
Naor Peled
69bc6c2dbf
revert(workflows): rollback to Node 12.16.3 (#537) 2023-11-17 20:45:54 +02:00
Naor Peled
9c1588a43e
chore: add CodeQL config 2023-11-13 11:56:25 +02:00
Naor Peled
fefa53ad95
fix(docs): resolve typos (#528) 2023-11-13 11:11:43 +02:00
Naor Peled
efb8e612a5
ci: move to Github Actions (#530) 2023-11-13 11:11:28 +02:00
Connor Bär
b86bce16af
fix(parser): resolve issues with array detection (#516)
- this change resolves issues with Next.js middlewares
2023-11-13 11:10:39 +02:00
Denis Demchenko
f09411489c Merge tag '2.11.0'
2.11.0 2.11.0
2020-09-12 11:22:47 +03:00
Denis Demchenko
e188e8aa73 Merge branch '2.11.0' into production 2020-09-12 11:22:47 +03:00
Denis Demchenko
1d64ecab12 chore: bump version, write changelog and docs 2020-09-12 11:22:31 +03:00
Ricard Fredin
5b11ac25ca Add missing typescript property declaration
The method getEngineName exists both in the project and the official docs. It's just missing in the typescript declaration file.
2020-09-12 10:39:01 +03:00
Denis Demchenko
53d54e248c
Merge pull request #428 from lancedikson/dependabot/npm_and_yarn/lodash-4.17.19
chore(deps): bump lodash from 4.17.15 to 4.17.19
2020-09-12 10:37:53 +03:00
Denis Demchenko
b7c67e9094
Merge pull request #431 from lancedikson/dependabot/npm_and_yarn/elliptic-6.5.3
chore(deps): bump elliptic from 6.5.1 to 6.5.3
2020-09-12 10:37:25 +03:00
Denis Demchenko
b2383edfcd
Merge pull request #440 from lancedikson/dependabot/npm_and_yarn/yargs-parser-13.1.2
chore(deps): bump yargs-parser from 13.1.1 to 13.1.2
2020-09-12 10:36:55 +03:00
Denis Demchenko
e431acf578
Merge pull request #442 from lancedikson/dependabot/npm_and_yarn/http-proxy-1.18.1
chore(deps): bump http-proxy from 1.18.0 to 1.18.1
2020-09-12 10:36:39 +03:00
Denis Demchenko
c504b110bb
Merge pull request #427 from YongliangDing/declaration-update
Update @returns of Parser.prototype.parse
2020-09-12 10:35:50 +03:00
Denis Demchenko
a6317d24ca
Merge pull request #438 from Cordazar/patch-2
Add missing typescript property declaration
2020-09-12 10:27:13 +03:00
Denis Demchenko
24dab5f699
Merge pull request #437 from willamesoares/include-alias-check
feat: add support for using alias in 'is' method
2020-09-12 10:25:35 +03:00
Denis Demchenko
444c54a726
Merge pull request #436 from willamesoares/master
feat(browser): add detection for Miui Browser
2020-09-12 10:25:04 +03:00
dependabot[bot]
bf24d05d5e
chore(deps): bump http-proxy from 1.18.0 to 1.18.1
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.18.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-10 04:58:23 +00:00
dependabot[bot]
1e4c408452
chore(deps): bump yargs-parser from 13.1.1 to 13.1.2
Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2.
- [Release notes](https://github.com/yargs/yargs-parser/releases)
- [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
- [Commits](https://github.com/yargs/yargs-parser/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-04 23:31:17 +00:00
Ricard Fredin
0deba6685e
Add missing typescript property declaration
The method getEngineName exists both in the project and the official docs. It's just missing in the typescript declaration file.
2020-08-28 22:02:26 +02:00
Will Soares
a9c4677c86 feat: add support for using alias in 'is' method 2020-08-23 16:55:29 -03:00
Will Soares
53d18c8994 increase test coverage 2020-08-23 14:42:33 -03:00
Will Soares
d5fe5657d1 feat(browser): add detection for Miui Browser 2020-08-23 13:58:07 -03:00
dependabot[bot]
c925fd755b
chore(deps): bump elliptic from 6.5.1 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.1 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.1...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-31 08:51:34 +00:00
dependabot[bot]
867992471a
chore(deps): bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-17 18:51:57 +00:00
dingyongliang
1bde6c6c7e Update @returns of Parser.prototype.parse 2020-07-14 15:04:07 +08:00
Denis Demchenko
33d6f9a37d Merge branch '2.10.0' into production 2020-07-09 22:12:50 +03:00
Denis Demchenko
d1a6532d82 Merge tag '2.10.0'
2.10.0 2.10.0
2020-07-09 22:12:50 +03:00
Denis Demchenko
cc546cfb44 chore(docs): regen docs 2020-07-09 22:11:59 +03:00
Denis Demchenko
77f394c8e7 chore(package): bump version, write changelog 2020-07-09 22:08:32 +03:00
Denis Demchenko
7adb0017dd
Merge pull request #397 from lancedikson/greenkeeper/sinon-9.0.0
Update sinon to the latest version 🚀
2020-07-09 21:51:01 +03:00
Denis Demchenko
a7bc7110e2
Merge pull request #417 from lancedikson/greenkeeper/compression-webpack-plugin-4.0.0
Update compression-webpack-plugin to the latest version 🚀
2020-07-09 21:50:45 +03:00
Denis Demchenko
7a273350d9
Merge pull request #410 from lancedikson/dependabot/npm_and_yarn/acorn-6.4.1
chore(deps): bump acorn from 6.2.0 to 6.4.1
2020-07-09 21:39:28 +03:00
Denis Demchenko
3d167b278e
Merge pull request #421 from lancedikson/greenkeeper/gh-pages-3.0.0
Update gh-pages to the latest version 🚀
2020-07-09 21:38:54 +03:00
Denis Demchenko
41c30ec722 fix(chore): bug with babel/helper-compilation on build
No "exports" main resolved in /home/runner/work/bowser/bowser/node_modules/@babel/helper-compilation-targets/package.json
2020-07-09 21:27:15 +03:00
Denis Demchenko
ba8f7d8a54 chore(tests): fix tests 2020-07-09 21:23:20 +03:00
Denis Demchenko
725de76e14 Revert "chore(tests): fix tests for Firefox iOS"
This reverts commit 9edfabf9
2020-07-09 21:23:10 +03:00
Denis Demchenko
9edfabf98a chore(tests): fix tests for Firefox iOS
relevant to #401
2020-06-02 00:32:35 +03:00
Denis Demchenko
3813d92a55 feat(browser): add detection of Opera Touch
fixes #414
2020-06-02 00:16:43 +03:00
Denis Demchenko
dbb433945a chore(travis): fix node_js version 2020-06-01 23:44:54 +03:00
Denis Demchenko
d3d710d158
Add bowser-online to README.md
closes #419
2020-06-01 23:39:46 +03:00
Denis Demchenko
9007a9e393
Merge pull request #415 from acailly/feat/handle-firefox-ipad-ios13
handle Firefox on iPad on iOS 13
2020-06-01 23:34:43 +03:00
Denis Demchenko
8fe4b98a56
Merge pull request #409 from pastak/master
add toLowerCase option to getBrowserName in typing
2020-06-01 23:33:00 +03:00
greenkeeper[bot]
57e6d2b5d3
chore(package): update lockfile package-lock.json 2020-05-29 20:31:29 +00:00
greenkeeper[bot]
98f32dfbf5
chore(package): update gh-pages to version 3.0.0 2020-05-29 20:31:26 +00:00
greenkeeper[bot]
a61817abb1
chore(package): update lockfile package-lock.json 2020-05-12 13:33:50 +00:00
greenkeeper[bot]
538ee8fe0e
chore(package): update compression-webpack-plugin to version 4.0.0 2020-05-12 13:33:47 +00:00
acailly
cb242c0242 handle Firefox on iPad on iOS 13 2020-04-28 11:37:01 +02:00
dependabot[bot]
a7cff0b965
chore(deps): bump acorn from 6.2.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.2.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.2.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-04 19:08:06 +00:00
pastak
efa7801204
add toLowerCase option to getBrowserName in typing
ref: a990b6b2f6/src/parser.js (L124)
2020-03-31 18:20:15 +09:00
Denis Demchenko
a990b6b2f6
Merge pull request #398 from pkuczynski/patch-1
Exclude unnecessary files from the npm package
2020-03-01 13:26:36 +02:00
Piotr Kuczynski
13ab38aebd
Exclude unnecessary files from the npm package
Listed a few files and folders which are currently included in the published npm package, while they should not be.
2020-02-25 16:58:43 +01:00
greenkeeper[bot]
437b6536ca
chore(package): update lockfile package-lock.json 2020-02-19 11:44:47 +00:00
greenkeeper[bot]
c83b241238
chore(package): update sinon to version 9.0.0 2020-02-19 11:44:43 +00:00
Denis Demchenko
743050f42e Merge branch '2.9.0' into production 2020-01-28 22:26:23 +02:00
Denis Demchenko
a1cbad9455 Merge tag '2.9.0'
2.9.0 2.9.0
2020-01-28 22:26:23 +02:00
Denis Demchenko
6add52d49c chore(package): bump version, write changelog 2020-01-28 22:26:13 +02:00
Denis Demchenko
0a790b84b8
Merge pull request #394 from lancedikson/greenkeeper/monorepo.babel7-20200114033043
Greenkeeper/monorepo.babel7 20200114033043
2020-01-28 21:55:41 +02:00
Denis Demchenko
433955ac68
Merge branch 'master' into greenkeeper/monorepo.babel7-20200114033043 2020-01-28 21:53:59 +02:00
Denis Demchenko
9af50fd1c7
Merge pull request #393 from lancedikson/greenkeeper/ava-3.0.0
Update ava to the latest version 🚀
2020-01-28 21:52:16 +02:00
Denis Demchenko
214cdb52bc
Merge pull request #392 from lancedikson/greenkeeper/eslint-plugin-ava-10.0.0
Update eslint-plugin-ava to the latest version 🚀
2020-01-28 21:52:02 +02:00
Denis Demchenko
07fcffe812
Merge pull request #390 from ashernguyen/AddTypeForIsBrowser
added type definition for `isBrowser` in Parser Class
2020-01-28 21:51:34 +02:00
Denis Demchenko
a8aa331c39
Merge pull request #388 from DarkPurple141/types-update
fix: only include types
2020-01-28 21:50:28 +02:00
greenkeeper[bot]
a4a1a86d25
chore(package): update lockfile package-lock.json 2020-01-19 15:21:11 +00:00
greenkeeper[bot]
be8860b731
chore(package): update ava to version 3.0.0 2020-01-19 15:21:06 +00:00
greenkeeper[bot]
5131706495
chore(package): update lockfile package-lock.json 2020-01-19 15:14:42 +00:00
greenkeeper[bot]
db8e9d4417
chore(package): update eslint-plugin-ava to version 10.0.0 2020-01-19 15:14:38 +00:00
greenkeeper[bot]
341dd8ef40
chore(package): update lockfile package-lock.json 2020-01-15 17:07:05 +00:00
greenkeeper[bot]
2132446318
chore(package): update @babel/register to version 7.8.3 2020-01-15 17:07:01 +00:00
greenkeeper[bot]
50f5a73386
chore(package): update @babel/preset-env to version 7.8.2 2020-01-15 17:06:57 +00:00
greenkeeper[bot]
e575388f48
chore(package): update @babel/polyfill to version 7.8.3 2020-01-15 17:06:54 +00:00
greenkeeper[bot]
b0b505fbe2
chore(package): update @babel/core to version 7.8.0 2020-01-15 17:06:49 +00:00
greenkeeper[bot]
48866a119e
chore(package): update @babel/cli to version 7.8.3 2020-01-15 17:06:46 +00:00
Asher Nguyen
a523ded89c added type definition for parser.isBrowser 2020-01-13 15:18:02 +11:00
Alex Hinds
7ebcbd799b include types 2020-01-06 15:54:39 +11:00
Alex Hinds
4e492fb6ae Merge branch 'master' of github.com:lancedikson/bowser into types-update 2020-01-06 15:52:21 +11:00
Alex Hinds
3544195aeb remove re-export 2020-01-06 15:52:14 +11:00
Denis Demchenko
f32c4fdc97 Merge branch '2.8.1' into production 2019-12-26 23:28:18 +02:00
Denis Demchenko
bdc8355216 Merge tag '2.8.1'
2.8.1 2.8.1
2019-12-26 23:28:18 +02:00
Denis Demchenko
01f5f2281e chore(package): bump version, write changelog 2019-12-26 23:28:09 +02:00
Denis Demchenko
24d1ce5e2c Revert "Merge pull request #382 from DarkPurple141/types-update"
This reverts commit 406e39d2fe, reversing
changes made to d238da4906.
2019-12-26 23:26:36 +02:00
Denis Demchenko
8e078bb0f4 Merge tag '2.8.0'
2.8.0 2.8.0
2019-12-26 16:46:14 +02:00
Denis Demchenko
16843fd15f Merge branch '2.8.0' into production 2019-12-26 16:46:13 +02:00
Denis Demchenko
ca7357338f chore(package): bump version 2019-12-26 16:45:29 +02:00
Denis Demchenko
50a4644a4e chore(changelog): write changelog 2019-12-26 16:43:56 +02:00
Denis Demchenko
6b59afee62
Merge pull request #386 from lancedikson/greenkeeper/nyc-15.0.0
Update nyc to the latest version 🚀
2019-12-26 16:21:01 +02:00
Denis Demchenko
15442b789b
Merge branch 'master' into greenkeeper/nyc-15.0.0 2019-12-26 16:18:07 +02:00
Denis Demchenko
a62e610f36
Merge pull request #385 from lancedikson/greenkeeper/babel-plugin-istanbul-6.0.0
Update babel-plugin-istanbul to the latest version 🚀
2019-12-26 16:16:41 +02:00
Denis Demchenko
bc3983cb8f
Merge pull request #384 from lancedikson/greenkeeper/sinon-8.0.0
Update sinon to the latest version 🚀
2019-12-26 16:16:16 +02:00
Denis Demchenko
3abf60fd8f
Merge pull request #361 from opencollective/opencollective
Activating Open Collective
2019-12-26 15:57:22 +02:00
Denis Demchenko
406e39d2fe
Merge pull request #382 from DarkPurple141/types-update
fix: update types to include constants in types.d.ts
2019-12-26 15:56:37 +02:00
Denis Demchenko
d238da4906
Merge pull request #383 from oliverfoster/issue/359
fixes #359 IE11 Added Array.prototype.find and Object.assign polyfills
2019-12-26 15:55:29 +02:00
Denis Demchenko
366a9c47e9
Merge pull request #381 from Tindtily/feature/add-wechat-ua
add windowswechat ua
2019-12-26 15:50:21 +02:00
Denis Demchenko
de5b4e02fe
Merge pull request #379 from neckro/production
Correctly detect Firefox on iPad
2019-12-26 15:48:46 +02:00
Denis Demchenko
9ecf3e94c3
Merge pull request #375 from Farfurix/add-electron
Add Electron support
2019-12-26 15:46:23 +02:00
greenkeeper[bot]
164835e190
chore(package): update lockfile package-lock.json 2019-12-23 01:13:49 +00:00
greenkeeper[bot]
0353113434
chore(package): update nyc to version 15.0.0 2019-12-23 01:13:44 +00:00
greenkeeper[bot]
4481d39247
chore(package): update lockfile package-lock.json 2019-12-23 01:00:00 +00:00
greenkeeper[bot]
460858d826
chore(package): update babel-plugin-istanbul to version 6.0.0 2019-12-23 00:59:55 +00:00
greenkeeper[bot]
0f57f77cbf
chore(package): update lockfile package-lock.json 2019-12-22 16:29:20 +00:00
greenkeeper[bot]
8122ad99a0
chore(package): update sinon to version 8.0.0 2019-12-22 16:29:15 +00:00
Alex Hinds
8fbbc33d87 Amended re-export to also import 2019-12-20 08:50:05 +11:00
Oliver foster
5a6af193d2 Extended test cases and fixed bug 2019-12-19 12:00:46 +00:00
Oliver foster
f27c7e0580 Edited typo 2019-12-19 11:49:50 +00:00
Oliver foster
b74bb0caa2 Added polyfill tests 2019-12-19 11:46:15 +00:00
Oliver foster
cad365b53e Fixed getSecondMatch test 2019-12-19 11:38:49 +00:00
Oliver foster
64bbd2a9b1 Fixed tests 2019-12-19 11:26:52 +00:00
Oliver foster
3cdfd7de02 Expanded test coverage for utils.js 2019-12-19 11:22:40 +00:00
Oliver foster
a54868776d Fixed linting issues 2019-12-19 10:51:30 +00:00
Oliver foster
e55055534f Fix travis errors 2019-12-19 10:45:33 +00:00
Oliver foster
97aa1e1972 Fix travis warnings 2019-12-19 10:36:51 +00:00
Oliver foster
d0dfa37e50 Added fallback to native functions 2019-12-19 10:12:52 +00:00
Oliver Foster
066f665aac
Changed bad code 2019-12-19 10:05:29 +00:00
Oliver foster
f5a908584c fixes #359 IE11 Added Array.prototype.find and Object.assign polyfills 2019-12-19 10:02:14 +00:00
Alex Hinds
9c3fc30c81 fix: update types to include constants 2019-12-19 17:05:56 +11:00
zhaoxiaohai
adde31f807 add windowswechat ua 2019-12-17 16:24:04 +08:00
Joseph Culbert
b213e4c8a6 Correctly detect Firefox on iPad 2019-12-13 16:40:59 -06:00
Farfurix
648daa5f9f Add Electron 2019-12-04 15:55:36 +03:00
Denis Demchenko
ea8d9c5427
npm i → npm ci 2019-10-02 21:50:47 +03:00
Denis Demchenko
d95fe87b06 Merge branch '2.7.0' into production 2019-10-02 21:47:13 +03:00
Denis Demchenko
4d66cad51e Merge tag '2.7.0'
2.7.0 2.7.0
2019-10-02 21:47:13 +03:00
Denis Demchenko
41384109cb chore(changelog): write changelog 2019-10-02 21:46:12 +03:00
Denis Demchenko
715ea30809 chore(package): bump version, update deps 2019-10-02 21:44:30 +03:00
Denis Demchenko
935d30f144
Merge pull request #346 from lancedikson/greenkeeper/eslint-plugin-ava-8.0.0
Update eslint-plugin-ava to the latest version 🚀
2019-10-02 21:30:41 +03:00
Denis Demchenko
a50efff25c
Merge pull request #350 from lancedikson/dependabot/npm_and_yarn/mixin-deep-1.3.2
chore(deps): bump mixin-deep from 1.3.1 to 1.3.2
2019-10-02 21:30:12 +03:00
Denis Demchenko
0ce5a8173a
Merge pull request #363 from navarroaxel/feat/gsa
feat(browsers): Add Google Search App detection
2019-10-02 21:26:25 +03:00
Denis Demchenko
bd2918e20e
Merge pull request #364 from lancedikson/greenkeeper/testem-3.0.0
Update testem to the latest version 🚀
2019-10-02 21:24:42 +03:00
Denis Demchenko
493c4fb2e7
Merge pull request #362 from kialo/support-qq-browser
Support QQ Browser
2019-10-02 21:13:43 +03:00
greenkeeper[bot]
23156b429b
chore(package): update lockfile package-lock.json 2019-09-30 17:44:59 +00:00
greenkeeper[bot]
1caea71a81
chore(package): update testem to version 3.0.0 2019-09-30 17:44:54 +00:00
Axel Navarro
e29357793a feat(browsers): Add Google Search App detection 2019-09-25 08:58:27 -03:00
jess
86465cf2ef
Update package.json
removed Open Collective postinstall
2019-09-24 06:52:58 -07:00
Mathias Kahl
e57c3d99d5 support QQ Browser 2019-09-18 10:34:14 +02:00
Jess
2b63c8c7b9 Added call to donate after npm install (optional) 2019-09-14 13:24:48 -07:00
Jess
16778c720d Added financial contributors to the README 2019-09-14 13:24:48 -07:00
Denis Demchenko
ea2f5254e0 Merge branch '2.6.1' into production 2019-09-10 19:04:43 +03:00
Denis Demchenko
bc2d51a8f9 Merge tag '2.6.1'
2.6.1 2.6.1
2019-09-10 19:04:43 +03:00
Denis Demchenko
94a58a2d80 2.6.1 2019-09-10 19:04:13 +03:00
Denis Demchenko
4f12f6bafd chore(package): expose pkg.browser
related to #355
2019-09-10 19:02:13 +03:00
Denis Demchenko
e0cabfeb29 Merge branch '2.6.0' into production 2019-09-06 14:35:38 +03:00
Denis Demchenko
9d4624b29a Merge tag '2.6.0'
2.6.0 2.6.0
2019-09-06 14:35:38 +03:00
Denis Demchenko
b8ef17a7ba chore(package): write changelog, bump version 2019-09-06 14:35:23 +03:00
Denis Demchenko
d9885c9de3 fix(platform): fix Tablet PC detection as tablets
fixes #334
2019-09-06 14:33:14 +03:00
Denis Demchenko
d09b91a4ca
Merge pull request #354 from Gudahtt/add-module-field
Add 'module' field to manifest
2019-09-06 12:33:55 +03:00
Mark Stacey
4356c0a503 Add 'module' field to manifest
The 'module' field is used by bundlers such as rollup and webpack to
determine the entrypoint for a package. Conventionally 'module' is used
for the ES6 entrypoint, and 'main' is used for the CommonJS entrypoint.

Adding a 'module' field allows importing bowser as an ES6 module
directly, rather than using a package-relative path to the ES6
entrypoint (e.g. `bowser/src/bowser`)

Closes #353
2019-09-05 18:28:47 -03:00
dependabot[bot]
5045e25f38
chore(deps): bump mixin-deep from 1.3.1 to 1.3.2
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-02 15:55:39 +00:00
Denis Demchenko
9791ffeaf6 Merge tag '2.5.4'
2.5.4 2.5.4
2019-09-02 18:53:44 +03:00
Denis Demchenko
8fb6e3a080
Update nodejs.yml 2019-08-27 20:17:55 +03:00
dependabot[bot]
3788cea8b1
Merge pull request #348 from lancedikson/dependabot/npm_and_yarn/eslint-utils-1.4.2 2019-08-27 17:17:13 +00:00
Denis Demchenko
40c6be6654
Activate github actions 2019-08-27 20:13:33 +03:00
dependabot[bot]
75f928c3bf
chore(deps): bump eslint-utils from 1.4.0 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-27 07:28:43 +00:00
greenkeeper[bot]
19da3c6ab9
chore(package): update lockfile package-lock.json 2019-08-18 12:58:33 +00:00
greenkeeper[bot]
b548f9fed2
chore(package): update eslint-plugin-ava to version 8.0.0 2019-08-18 12:58:29 +00:00
Denis Demchenko
642fd6164f
Update README.md 2019-08-06 14:19:35 +03:00
Denis Demchenko
594b5be6c7 Merge tag '2.5.3'
2.5.3
2019-08-04 23:57:22 +03:00
29 changed files with 6657 additions and 3095 deletions

View File

@ -1 +1 @@
repo_token: Ba2bS7pOlSLZWuESBnff8qxDjIS8Mg1Z0

19
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
template: |
## Changes
$CHANGES

View File

@ -0,0 +1,20 @@
name: 📝 Draft or update next release
concurrency: draft_or_update_next_release
on:
push:
branches:
- main
workflow_dispatch:
jobs:
prepare-deployment:
name: 📝 Draft or update next release
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v1
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

38
.github/workflows/merge-to-master.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: 'Merge to master'
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.16.3]
steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g nyc
- run: npm ci
- run: npm run build
- run: nyc npm test && nyc report --reporter=text-lcov | ./node_modules/coveralls/bin/coveralls.js
env:
COVERALLS_SERVICE_NAME: GithubActions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_BRANCH: ${{ env.BRANCH_NAME }}

29
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Release
on:
# This job runs when a new release is published
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
# Store the name of the release
# See https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: npm ci
- run: npm version $RELEASE_VERSION --no-git-tag-version
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.BOWSER_NPM_PUBLISH_TOKEN }}

44
.github/workflows/pull-request.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: 'Pull Request'
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12.16.3]
name: Node ${{ matrix.node }}
steps:
- name: 'Checkout latest code'
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm run test
lint:
name: 'ESLint'
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint:check

View File

@ -5,3 +5,6 @@ coverage
node_modules node_modules
.github .github
docs docs
*.gz
jsdoc.json
webpack.config.js

View File

@ -1,8 +0,0 @@
language: node_js
after_success: npm run coverage
node_js:
- "12"
script:
- npm run lint
- npm run build
- npm test

View File

@ -1,5 +1,38 @@
# Bowser Changelog # Bowser Changelog
### 2.11.0 (Sep 12, 2020)
- [ADD] Added support for aliases in `Parser#is` method (#437)
- [ADD] Added more typings (#438, #427)
- [ADD] Added support for MIUI Browser (#436)
### 2.10.0 (Jul 9, 2020)
- [FIX] Fix for Firefox detection on iOS 13 [#415]
- [FIX] Fixes for typings.d.ts [#409]
- [FIX] Updated development dependencies
### 2.9.0 (Jan 28, 2020)
- [ADD] Export more methods and constants via .d.ts [#388], [#390]
### 2.8.1 (Dec 26, 2019)
- [FIX] Reverted [#382] as it broke build
### 2.8.0 (Dec 26, 2019)
- [ADD] Add polyfills for Array.find & Object.assign [#383]
- [ADD] Export constants with types.d.ts [#382]
- [FIX] Add support for WeChat on Windows [#381]
- [FIX] Fix detection of Firefox on iPad [#379]
- [FIX] Add detection of Electron [#375]
- [FIX] Updated dev-dependencies
### 2.7.0 (Oct 2, 2019)
- [FIX] Add support for QQ Browser [#362]
- [FIX] Add support for GSA [#364]
- [FIX] Updated dependencies
### 2.6.0 (Sep 6, 2019)
- [ADD] Define "module" export in package.json [#354]
- [FIX] Fix Tablet PC detection [#334]
### 2.5.4 (Sep 2, 2019) ### 2.5.4 (Sep 2, 2019)
- [FIX] Exclude docs from the npm package [#349] - [FIX] Exclude docs from the npm package [#349]

View File

@ -6,21 +6,19 @@ A small, fast and rich-API browser/platform/engine detector for both browser and
Don't hesitate to support the project on Github or [OpenCollective](https://opencollective.com/bowser) if you like it ❤️ Also, contributors are always welcome! Don't hesitate to support the project on Github or [OpenCollective](https://opencollective.com/bowser) if you like it ❤️ Also, contributors are always welcome!
[![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser/) [![Greenkeeper badge](https://badges.greenkeeper.io/lancedikson/bowser.svg)](https://greenkeeper.io/) [![Coverage Status](https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master)](https://coveralls.io/github/lancedikson/bowser?branch=master) [![Financial Contributors on Open Collective](https://opencollective.com/bowser/all/badge.svg?label=financial+contributors)](https://opencollective.com/bowser) [![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser/) [![Greenkeeper badge](https://badges.greenkeeper.io/lancedikson/bowser.svg)](https://greenkeeper.io/) [![Coverage Status](https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master)](https://coveralls.io/github/lancedikson/bowser?branch=master) ![Downloads](https://img.shields.io/npm/dm/bowser)
# Contents # Contents
- [Overview](#overview) - [Overview](#overview)
- [Use cases](#use-cases) - [Use cases](#use-cases)
- [Advanced usage](#advanced-usage)
- [How can I help?](#contributing)
# Overview # Overview
The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers. The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers. Check it out on this page: https://bowser-js.github.io/bowser-online/.
### ⚠️ Version 2.0 breaking changes ⚠️ ### ⚠️ Version 2.0 breaking changes ⚠️
Version 2.0 has drastically changed the API. All available methods are on the [docs page](https://lancedikson.github.io/bowser/docs). Version 2.0 has drastically changed the API. All available methods are on the [docs page](https://bowser-js.github.io/bowser/docs/).
_For legacy code, check out the [1.x](https://github.com/lancedikson/bowser/tree/v1.x) branch and install it through `npm install bowser@1.9.4`._ _For legacy code, check out the [1.x](https://github.com/lancedikson/bowser/tree/v1.x) branch and install it through `npm install bowser@1.9.4`._
@ -145,5 +143,35 @@ list of aliases can be found in [the file](src/constants.js).
## Similar Projects ## Similar Projects
* [Kong](https://github.com/BigBadBleuCheese/Kong) - A C# port of Bowser. * [Kong](https://github.com/BigBadBleuCheese/Kong) - A C# port of Bowser.
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](.github/CONTRIBUTING.md)].
<a href="https://github.com/lancedikson/bowser/graphs/contributors"><img src="https://opencollective.com/bowser/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/bowser/contribute)]
#### Individuals
<a href="https://opencollective.com/bowser"><img src="https://opencollective.com/bowser/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/bowser/contribute)]
<a href="https://opencollective.com/bowser/organization/0/website"><img src="https://opencollective.com/bowser/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/1/website"><img src="https://opencollective.com/bowser/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/2/website"><img src="https://opencollective.com/bowser/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/3/website"><img src="https://opencollective.com/bowser/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/4/website"><img src="https://opencollective.com/bowser/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/5/website"><img src="https://opencollective.com/bowser/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/6/website"><img src="https://opencollective.com/bowser/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/7/website"><img src="https://opencollective.com/bowser/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/8/website"><img src="https://opencollective.com/bowser/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/9/website"><img src="https://opencollective.com/bowser/organization/9/avatar.svg"></a>
## License ## License
Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -492,7 +492,7 @@ explicitly. Same as <code>skipParsing</code> for <a href="Parser.html">Parser</a
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -1498,7 +1498,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line330">line 330</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line331">line 331</a>
</li></ul></dd> </li></ul></dd>
@ -1700,7 +1700,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
<h4 class="name" id="is"><span class="type-signature"></span>is<span class="signature">(anything)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <h4 class="name" id="is"><span class="type-signature"></span>is<span class="signature">(anything, includingAlias<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
@ -1712,7 +1712,7 @@ like <a href="Parser.html#parseBrowser">Parser#parseBrowser</a> or <a href="Pars
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line476">line 476</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line481">line 481</a>
</li></ul></dd> </li></ul></dd>
@ -1779,8 +1779,12 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<th>Type</th> <th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th> <th class="last">Description</th>
</tr> </tr>
@ -1804,13 +1808,59 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
</td> </td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"></td> <td class="description last"></td>
</tr> </tr>
<tr>
<td class="name"><code>includingAlias</code></td>
<td class="type">
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
<code>false</code>
</td>
<td class="description last"><p>The flag showing whether alias will be included into comparison</p></td>
</tr>
</tbody> </tbody>
</table> </table>
@ -1867,7 +1917,7 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line411">line 411</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line415">line 415</a>
</li></ul></dd> </li></ul></dd>
@ -2054,7 +2104,7 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"></span></h4> <h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Parser.html">Parser</a>}</span></h4>
@ -2066,7 +2116,7 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line317">line 317</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line318">line 318</a>
</li></ul></dd> </li></ul></dd>
@ -2133,6 +2183,24 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Parser.html">Parser</a></span>
</dd>
</dl>
@ -2576,7 +2644,7 @@ the OS called &quot;anything&quot; or the platform called &quot;anything&quot;</
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line352">line 352</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line353">line 353</a>
</li></ul></dd> </li></ul></dd>
@ -2750,7 +2818,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line485">line 485</a> <a href="parser.js.html">parser.js</a>, <a href="parser.js.html#line491">line 491</a>
</li></ul></dd> </li></ul></dd>
@ -3061,7 +3129,7 @@ Returns <code>undefined</code> when the browser is no described in the checkTree
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -133,7 +133,7 @@ export default Bowser;
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -124,6 +124,360 @@
<h4 class="name" id="assign"><span class="type-signature"></span>assign<span class="signature">(obj)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line265">line 265</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Object::assign polyfill</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>obj</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>...objs</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="find"><span class="type-signature"></span>find<span class="signature">(arr, predicate)</span><span class="type-signature"> &rarr; {Array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line243">line 243</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Array::find polyfill</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>arr</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>predicate</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id="getAndroidVersionName"><span class="type-signature"></span>getAndroidVersionName<span class="signature">(version)</span><span class="type-signature"> &rarr; {string}</span></h4> <h4 class="name" id="getAndroidVersionName"><span class="type-signature"></span>getAndroidVersionName<span class="signature">(version)</span><span class="type-signature"> &rarr; {string}</span></h4>
@ -314,7 +668,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line243">line 243</a> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line293">line 293</a>
</li></ul></dd> </li></ul></dd>
@ -461,7 +815,7 @@
<h4 class="name" id="getBrowserTypeByAlias"><span class="type-signature"></span>getBrowserTypeByAlias<span class="signature">(browserName)</span><span class="type-signature"> &rarr; {string}</span></h4> <h4 class="name" id="getBrowserTypeByAlias"><span class="type-signature"></span>getBrowserTypeByAlias<span class="signature">(browserAlias)</span><span class="type-signature"> &rarr; {string}</span></h4>
@ -473,7 +827,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line256">line 256</a> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line306">line 306</a>
</li></ul></dd> </li></ul></dd>
@ -556,7 +910,7 @@
<tr> <tr>
<td class="name"><code>browserName</code></td> <td class="name"><code>browserAlias</code></td>
<td class="type"> <td class="type">
@ -1338,7 +1692,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line222">line 222</a> <a href="utils.js.html">utils.js</a>, <a href="utils.js.html#line224">line 224</a>
</li></ul></dd> </li></ul></dd>
@ -2352,7 +2706,7 @@ like <code>&quot;iPhone&quot;</code> or <code>&quot;Kindle Fire HD 7&quot;</code
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -65,7 +65,7 @@
<li><strong>Multi-platform.</strong> It's browser- and node-ready, so you can use it in any environment.</li> <li><strong>Multi-platform.</strong> It's browser- and node-ready, so you can use it in any environment.</li>
</ul> </ul>
<p>Don't hesitate to support the project on Github or <a href="https://opencollective.com/bowser">OpenCollective</a> if you like it ❤️ Also, contributors are always welcome!</p> <p>Don't hesitate to support the project on Github or <a href="https://opencollective.com/bowser">OpenCollective</a> if you like it ❤️ Also, contributors are always welcome!</p>
<p><a href="https://travis-ci.org/lancedikson/bowser/"><img src="https://travis-ci.org/lancedikson/bowser.svg?branch=master" alt="Build Status"></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/lancedikson/bowser.svg" alt="Greenkeeper badge"></a> <a href="https://coveralls.io/github/lancedikson/bowser?branch=master"><img src="https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master" alt="Coverage Status"></a></p> <p><a href="https://opencollective.com/bowser"><img src="https://opencollective.com/bowser/all/badge.svg?label=financial+contributors" alt="Financial Contributors on Open Collective"></a> <a href="https://travis-ci.org/lancedikson/bowser/"><img src="https://travis-ci.org/lancedikson/bowser.svg?branch=master" alt="Build Status"></a> <a href="https://greenkeeper.io/"><img src="https://badges.greenkeeper.io/lancedikson/bowser.svg" alt="Greenkeeper badge"></a> <a href="https://coveralls.io/github/lancedikson/bowser?branch=master"><img src="https://coveralls.io/repos/github/lancedikson/bowser/badge.svg?branch=master" alt="Coverage Status"></a> <img src="https://img.shields.io/npm/dm/bowser" alt="Downloads"></p>
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#overview">Overview</a></li> <li><a href="#overview">Overview</a></li>
@ -74,7 +74,7 @@
<li><a href="#contributing">How can I help?</a></li> <li><a href="#contributing">How can I help?</a></li>
</ul> </ul>
<h1>Overview</h1> <h1>Overview</h1>
<p>The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers.</p> <p>The library is made to help to detect what browser your user has and gives you a convenient API to filter the users somehow depending on their browsers. Check it out on this page: https://bowser-js.github.io/bowser-online/.</p>
<h3>⚠️ Version 2.0 breaking changes ⚠️</h3> <h3>⚠️ Version 2.0 breaking changes ⚠️</h3>
<p>Version 2.0 has drastically changed the API. All available methods are on the <a href="https://lancedikson.github.io/bowser/docs">docs page</a>.</p> <p>Version 2.0 has drastically changed the API. All available methods are on the <a href="https://lancedikson.github.io/bowser/docs">docs page</a>.</p>
<p><em>For legacy code, check out the <a href="https://github.com/lancedikson/bowser/tree/v1.x">1.x</a> branch and install it through <code>npm install bowser@1.9.4</code>.</em></p> <p><em>For legacy code, check out the <a href="https://github.com/lancedikson/bowser/tree/v1.x">1.x</a> branch and install it through <code>npm install bowser@1.9.4</code>.</em></p>
@ -174,6 +174,26 @@ list of aliases can be found in <a href="src/constants.js">the file</a>.</p>
<ul> <ul>
<li><a href="https://github.com/BigBadBleuCheese/Kong">Kong</a> - A C# port of Bowser.</li> <li><a href="https://github.com/BigBadBleuCheese/Kong">Kong</a> - A C# port of Bowser.</li>
</ul> </ul>
<h2>Contributors</h2>
<h3>Code Contributors</h3>
<p>This project exists thanks to all the people who contribute. [<a href="CONTRIBUTING.md">Contribute</a>].
<a href="https://github.com/lancedikson/bowser/graphs/contributors"><img src="https://opencollective.com/bowser/contributors.svg?width=890&button=false" /></a></p>
<h3>Financial Contributors</h3>
<p>Become a financial contributor and help us sustain our community. [<a href="https://opencollective.com/bowser/contribute">Contribute</a>]</p>
<h4>Individuals</h4>
<p><a href="https://opencollective.com/bowser"><img src="https://opencollective.com/bowser/individuals.svg?width=890"></a></p>
<h4>Organizations</h4>
<p>Support this project with your organization. Your logo will show up here with a link to your website. [<a href="https://opencollective.com/bowser/contribute">Contribute</a>]</p>
<p><a href="https://opencollective.com/bowser/organization/0/website"><img src="https://opencollective.com/bowser/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/1/website"><img src="https://opencollective.com/bowser/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/2/website"><img src="https://opencollective.com/bowser/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/3/website"><img src="https://opencollective.com/bowser/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/4/website"><img src="https://opencollective.com/bowser/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/5/website"><img src="https://opencollective.com/bowser/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/6/website"><img src="https://opencollective.com/bowser/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/7/website"><img src="https://opencollective.com/bowser/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/8/website"><img src="https://opencollective.com/bowser/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/bowser/organization/9/website"><img src="https://opencollective.com/bowser/organization/9/avatar.svg"></a></p>
<h2>License</h2> <h2>License</h2>
<p>Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.</p></article> <p>Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.</p></article>
</section> </section>
@ -190,7 +210,7 @@ list of aliases can be found in <a href="src/constants.js">the file</a>.</p>
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -126,7 +126,7 @@ class Parser {
parseBrowser() { parseBrowser() {
this.parsedResult.browser = {}; this.parsedResult.browser = {};
const browserDescriptor = browserParsersList.find((_browser) => { const browserDescriptor = Utils.find(browserParsersList, (_browser) => {
if (typeof _browser.test === 'function') { if (typeof _browser.test === 'function') {
return _browser.test(this); return _browser.test(this);
} }
@ -209,7 +209,7 @@ class Parser {
parseOS() { parseOS() {
this.parsedResult.os = {}; this.parsedResult.os = {};
const os = osParsersList.find((_os) => { const os = Utils.find(osParsersList, (_os) => {
if (typeof _os.test === 'function') { if (typeof _os.test === 'function') {
return _os.test(this); return _os.test(this);
} }
@ -285,7 +285,7 @@ class Parser {
parsePlatform() { parsePlatform() {
this.parsedResult.platform = {}; this.parsedResult.platform = {};
const platform = platformParsersList.find((_platform) => { const platform = Utils.find(platformParsersList, (_platform) => {
if (typeof _platform.test === 'function') { if (typeof _platform.test === 'function') {
return _platform.test(this); return _platform.test(this);
} }
@ -336,7 +336,7 @@ class Parser {
parseEngine() { parseEngine() {
this.parsedResult.engine = {}; this.parsedResult.engine = {};
const engine = enginesParsersList.find((_engine) => { const engine = Utils.find(enginesParsersList, (_engine) => {
if (typeof _engine.test === 'function') { if (typeof _engine.test === 'function') {
return _engine.test(this); return _engine.test(this);
} }
@ -357,6 +357,7 @@ class Parser {
/** /**
* Parse full information about the browser * Parse full information about the browser
* @returns {Parser}
*/ */
parse() { parse() {
this.parseBrowser(); this.parseBrowser();
@ -372,7 +373,7 @@ class Parser {
* @return {ParsedResult} * @return {ParsedResult}
*/ */
getResult() { getResult() {
return Object.assign({}, this.parsedResult); return Utils.assign({}, this.parsedResult);
} }
/** /**
@ -414,7 +415,7 @@ class Parser {
if (platformsAndOSCounter > 0) { if (platformsAndOSCounter > 0) {
const platformsAndOSNames = Object.keys(platformsAndOSes); const platformsAndOSNames = Object.keys(platformsAndOSes);
const OSMatchingDefinition = platformsAndOSNames.find(name => (this.isOS(name))); const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name)));
if (OSMatchingDefinition) { if (OSMatchingDefinition) {
const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]); const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);
@ -424,7 +425,10 @@ class Parser {
} }
} }
const platformMatchingDefinition = platformsAndOSNames.find(name => (this.isPlatform(name))); const platformMatchingDefinition = Utils.find(
platformsAndOSNames,
name => (this.isPlatform(name)),
);
if (platformMatchingDefinition) { if (platformMatchingDefinition) {
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]); const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
@ -436,7 +440,7 @@ class Parser {
if (browsersCounter > 0) { if (browsersCounter > 0) {
const browserNames = Object.keys(browsers); const browserNames = Object.keys(browsers);
const matchingDefinition = browserNames.find(name => (this.isBrowser(name, true))); const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true)));
if (matchingDefinition !== void 0) { if (matchingDefinition !== void 0) {
return this.compareVersion(browsers[matchingDefinition]); return this.compareVersion(browsers[matchingDefinition]);
@ -515,10 +519,12 @@ class Parser {
* Is anything? Check if the browser is called "anything", * Is anything? Check if the browser is called "anything",
* the OS called "anything" or the platform called "anything" * the OS called "anything" or the platform called "anything"
* @param {String} anything * @param {String} anything
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {Boolean} * @returns {Boolean}
*/ */
is(anything) { is(anything, includingAlias = false) {
return this.isBrowser(anything) || this.isOS(anything) || this.isPlatform(anything); return this.isBrowser(anything, includingAlias) || this.isOS(anything)
|| this.isPlatform(anything);
} }
/** /**
@ -546,7 +552,7 @@ export default Parser;
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

View File

@ -27,7 +27,7 @@
<nav > <nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Bowser.html">Bowser</a><ul class='methods'><li data-type='method'><a href="Bowser.html#.getParser">getParser</a></li><li data-type='method'><a href="Bowser.html#.parse">parse</a></li></ul></li><li><a href="Parser.html">Parser</a><ul class='methods'><li data-type='method'><a href="Parser.html#getBrowser">getBrowser</a></li><li data-type='method'><a href="Parser.html#getBrowserName">getBrowserName</a></li><li data-type='method'><a href="Parser.html#getBrowserVersion">getBrowserVersion</a></li><li data-type='method'><a href="Parser.html#getEngine">getEngine</a></li><li data-type='method'><a href="Parser.html#getEngineName">getEngineName</a></li><li data-type='method'><a href="Parser.html#getOS">getOS</a></li><li data-type='method'><a href="Parser.html#getOSName">getOSName</a></li><li data-type='method'><a href="Parser.html#getOSVersion">getOSVersion</a></li><li data-type='method'><a href="Parser.html#getPlatform">getPlatform</a></li><li data-type='method'><a href="Parser.html#getPlatformType">getPlatformType</a></li><li data-type='method'><a href="Parser.html#getResult">getResult</a></li><li data-type='method'><a href="Parser.html#getUA">getUA</a></li><li data-type='method'><a href="Parser.html#is">is</a></li><li data-type='method'><a href="Parser.html#isBrowser">isBrowser</a></li><li data-type='method'><a href="Parser.html#parse">parse</a></li><li data-type='method'><a href="Parser.html#parseBrowser">parseBrowser</a></li><li data-type='method'><a href="Parser.html#parseEngine">parseEngine</a></li><li data-type='method'><a href="Parser.html#parseOS">parseOS</a></li><li data-type='method'><a href="Parser.html#parsePlatform">parsePlatform</a></li><li data-type='method'><a href="Parser.html#satisfies">satisfies</a></li><li data-type='method'><a href="Parser.html#some">some</a></li><li data-type='method'><a href="Parser.html#test">test</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#assign">assign</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#getAndroidVersionName">getAndroidVersionName</a></li><li><a href="global.html#getBrowserAlias">getBrowserAlias</a></li><li><a href="global.html#getBrowserTypeByAlias">getBrowserTypeByAlias</a></li><li><a href="global.html#getFirstMatch">getFirstMatch</a></li><li><a href="global.html#getMacOSVersionName">getMacOSVersionName</a></li><li><a href="global.html#getSecondMatch">getSecondMatch</a></li><li><a href="global.html#getVersionPrecision">getVersionPrecision</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#matchAndReturnConst">matchAndReturnConst</a></li></ul>
</nav> </nav>
<div id="main"> <div id="main">
@ -254,6 +254,8 @@ export default class Utils {
return -1; return -1;
} }
} }
return undefined;
} }
/** /**
@ -275,6 +277,54 @@ export default class Utils {
return result; return result;
} }
/**
* Array::find polyfill
*
* @param {Array} arr
* @param {Function} predicate
* @return {Array}
*/
static find(arr, predicate) {
let i;
let l;
if (Array.prototype.find) {
return Array.prototype.find.call(arr, predicate);
}
for (i = 0, l = arr.length; i &lt; l; i += 1) {
const value = arr[i];
if (predicate(value, i)) {
return value;
}
}
return undefined;
}
/**
* Object::assign polyfill
*
* @param {Object} obj
* @param {Object} ...objs
* @return {Object}
*/
static assign(obj, ...assigners) {
const result = obj;
let i;
let l;
if (Object.assign) {
return Object.assign(obj, ...assigners);
}
for (i = 0, l = assigners.length; i &lt; l; i += 1) {
const assigner = assigners[i];
if (typeof assigner === 'object' &amp;&amp; assigner !== null) {
const keys = Object.keys(assigner);
keys.forEach((key) => {
result[key] = assigner[key];
});
}
}
return obj;
}
/** /**
* Get short version/alias for a browser name * Get short version/alias for a browser name
* *
@ -294,11 +344,11 @@ export default class Utils {
* @example * @example
* getBrowserAlias('edge') // Microsoft Edge * getBrowserAlias('edge') // Microsoft Edge
* *
* @param {string} browserName * @param {string} browserAlias
* @return {string} * @return {string}
*/ */
static getBrowserTypeByAlias(browserAlia) { static getBrowserTypeByAlias(browserAlias) {
return BROWSER_MAP[browserAlia] || ''; return BROWSER_MAP[browserAlias] || '';
} }
} }
</code></pre> </code></pre>
@ -315,7 +365,7 @@ export default class Utils {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sun Aug 04 2019 23:53:02 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Sat Sep 12 2020 11:21:13 GMT+0300 (Eastern European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>

104
index.d.ts vendored
View File

@ -2,7 +2,7 @@
// Project: https://github.com/lancedikson/bowser // Project: https://github.com/lancedikson/bowser
// Definitions by: Alexander P. Cerutti <https://github.com/alexandercerutti>, // Definitions by: Alexander P. Cerutti <https://github.com/alexandercerutti>,
export = Bowser; export default Bowser;
export as namespace Bowser; export as namespace Bowser;
declare namespace Bowser { declare namespace Bowser {
@ -22,10 +22,26 @@ declare namespace Bowser {
function parse(UA: string): Parser.ParsedResult; function parse(UA: string): Parser.ParsedResult;
/**
* Constants exposed via bowser getters
*/
const BROWSER_MAP: Record<string, string>;
const ENGINE_MAP: Record<string, string>;
const OS_MAP: Record<string, string>;
const PLATFORMS_MAP: Record<string, string>;
namespace Parser { namespace Parser {
interface Parser { interface Parser {
constructor(UA: string, skipParsing?: boolean): Parser.Parser; constructor(UA: string, skipParsing?: boolean): Parser.Parser;
/**
* Check if the version is equals the browser version
* @param version The string to compare with the browser version
* @returns {boolean}
*/
compareVersion(version: string): boolean;
/** /**
* Get parsed browser object * Get parsed browser object
* @return {BrowserDetails} Browser's details * @return {BrowserDetails} Browser's details
@ -35,17 +51,18 @@ declare namespace Bowser {
/** /**
* Get browser's name * Get browser's name
* @param {Boolean} [toLowerCase] return lower-cased value
* @return {String} Browser's name or an empty string * @return {String} Browser's name or an empty string
*/ */
getBrowserName(): string; getBrowserName(toLowerCase?: boolean): string;
/** /**
* Get browser's version * Get browser's version
* @return {String} version of browser * @return {String} version of browser
*/ */
getBrowserVersion(): string; getBrowserVersion(): string | undefined;
/** /**
* Get OS * Get OS
@ -96,6 +113,13 @@ declare namespace Bowser {
getEngine(): EngineDetails; getEngine(): EngineDetails;
/**
* Get parsed engine's name
* @returns {String} Engine's name or an empty string
*/
getEngineName(): string;
/** /**
* Get parsed result * Get parsed result
* @return {ParsedResult} * @return {ParsedResult}
@ -114,16 +138,51 @@ declare namespace Bowser {
* Is anything? Check if the browser is called "anything", * Is anything? Check if the browser is called "anything",
* the OS called "anything" or the platform called "anything" * the OS called "anything" or the platform called "anything"
* @param {String} anything * @param {String} anything
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {Boolean} * @returns {Boolean}
*/ */
is(anything: any): boolean; is(anything: any, includingAlias?: boolean): boolean;
/**
* Check if the browser name equals the passed string
* @param browserName The string to compare with the browser name
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {boolean}
*/
isBrowser(browserName: string, includingAlias?: boolean): boolean;
/**
* Check if the engine name equals the passed string
* @param engineName The string to compare with the engine name
* @returns {boolean}
*/
isEngine(engineName: string): boolean;
/**
* Check if the OS name equals the passed string
* @param OSName The string to compare with the OS name
* @returns {boolean}
*/
isOS(OSName: string): boolean;
/**
* Check if the platform name equals the passed string
* @param platformName The string to compare with the platform name
* @returns {boolean}
*/
isPlatform(platformName: string): boolean;
/** /**
* Parse full information about the browser * Parse full information about the browser
* @returns {Parser.Parser}
*/ */
parse(): void; parse(): Parser.Parser;
/** /**
* Get parsed browser object * Get parsed browser object
@ -175,7 +234,40 @@ declare namespace Bowser {
satisfies(checkTree: checkTree): boolean | undefined; satisfies(checkTree: checkTree): boolean | undefined;
/** /**
* Check if any of the given values satifies `.is(anything)` * Check if the browser name equals the passed string
* @param {string} browserName The string to compare with the browser name
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {boolean}
*/
isBrowser(browserName: string, includingAlias?: boolean): boolean;
/**
* Check if the engine name equals the passed string
* @param {string} engineName The string to compare with the engine name
* @returns {boolean}
*/
isEngine(engineName: string): boolean;
/**
* Check if the platform type equals the passed string
* @param {string} platformType The string to compare with the platform type
* @returns {boolean}
*/
isPlatform(platformType: string): boolean;
/**
* Check if the OS name equals the passed string
* @param {string} osName The string to compare with the OS name
* @returns {boolean}
*/
isOS(osName: string): boolean;
/**
* Check if any of the given values satisfies `.is(anything)`
* @param {string[]} anythings * @param {string[]} anythings
* @returns {boolean} true if at least one condition is satisfied, false otherwise. * @returns {boolean} true if at least one condition is satisfied, false otherwise.
*/ */

8096
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
{ {
"name": "bowser", "name": "bowser",
"version": "2.5.4",
"description": "Lightweight browser detector", "description": "Lightweight browser detector",
"keywords": [ "keywords": [
"browser", "browser",
@ -21,37 +20,39 @@
} }
], ],
"main": "es5.js", "main": "es5.js",
"browser": "es5.js",
"module": "src/bowser.js",
"types": "index.d.ts", "types": "index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/lancedikson/bowser.git" "url": "git+https://github.com/lancedikson/bowser.git"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.5.0", "@babel/cli": "^7.11.6",
"@babel/core": "^7.5.4", "@babel/core": "^7.8.0",
"@babel/polyfill": "^7.4.4", "@babel/polyfill": "^7.8.3",
"@babel/preset-env": "^7.5.4", "@babel/preset-env": "^7.8.2",
"@babel/register": "^7.4.4", "@babel/register": "^7.8.3",
"ava": "^2.2.0", "ava": "^3.0.0",
"babel-eslint": "^10.0.2", "babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-plugin-add-module-exports": "^1.0.2", "babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-istanbul": "^5.1.4", "babel-plugin-istanbul": "^6.0.0",
"compression-webpack-plugin": "^3.0.0", "compression-webpack-plugin": "^4.0.0",
"coveralls": "^3.0.5", "coveralls": "^3.0.6",
"docdash": "^1.1.1", "docdash": "^1.1.1",
"eslint": "^6.0.1", "eslint": "^6.5.1",
"eslint-config-airbnb-base": "^13.2.0", "eslint-config-airbnb-base": "^13.2.0",
"eslint-plugin-ava": "^7.1.0", "eslint-plugin-ava": "^10.0.0",
"eslint-plugin-import": "^2.18.0", "eslint-plugin-import": "^2.18.2",
"gh-pages": "^2.0.1", "gh-pages": "^3.0.0",
"jsdoc": "^3.6.3", "jsdoc": "^3.6.3",
"nyc": "^14.1.1", "nyc": "^15.0.0",
"sinon": "^7.3.2", "sinon": "^9.0.0",
"testem": "^2.17.0", "testem": "^3.0.0",
"webpack": "^4.39.1", "webpack": "^4.41.0",
"webpack-bundle-analyzer": "^3.3.2", "webpack-bundle-analyzer": "^3.5.2",
"webpack-cli": "^3.3.6", "webpack-cli": "^3.3.9",
"yamljs": "^0.3.0" "yamljs": "^0.3.0"
}, },
"ava": { "ava": {
@ -69,9 +70,9 @@
"build": "webpack --config webpack.config.js", "build": "webpack --config webpack.config.js",
"generate-and-deploy-docs": "npm run generate-docs && gh-pages --dist docs --dest docs", "generate-and-deploy-docs": "npm run generate-docs && gh-pages --dist docs --dest docs",
"watch": "webpack --watch --config webpack.config.js", "watch": "webpack --watch --config webpack.config.js",
"deploy": "jsdoc -c jsdoc.json && gh-pages --dist docs --dest docs",
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build",
"lint": "eslint ./src", "lint:check": "eslint ./src",
"lint:fix": "eslint --fix ./src",
"testem": "testem", "testem": "testem",
"test": "nyc --reporter=html --reporter=text ava", "test": "nyc --reporter=html --reporter=text ava",
"test:watch": "ava --watch", "test:watch": "ava --watch",

View File

@ -7,10 +7,12 @@ export const BROWSER_ALIASES_MAP = {
BlackBerry: 'blackberry', BlackBerry: 'blackberry',
Chrome: 'chrome', Chrome: 'chrome',
Chromium: 'chromium', Chromium: 'chromium',
Electron: 'electron',
Epiphany: 'epiphany', Epiphany: 'epiphany',
Firefox: 'firefox', Firefox: 'firefox',
Focus: 'focus', Focus: 'focus',
Generic: 'generic', Generic: 'generic',
'Google Search': 'google_search',
Googlebot: 'googlebot', Googlebot: 'googlebot',
'Internet Explorer': 'ie', 'Internet Explorer': 'ie',
'K-Meleon': 'k_meleon', 'K-Meleon': 'k_meleon',
@ -20,9 +22,12 @@ export const BROWSER_ALIASES_MAP = {
'NAVER Whale Browser': 'naver', 'NAVER Whale Browser': 'naver',
Opera: 'opera', Opera: 'opera',
'Opera Coast': 'opera_coast', 'Opera Coast': 'opera_coast',
'Pale Moon': 'pale_moon',
PhantomJS: 'phantomjs', PhantomJS: 'phantomjs',
Puffin: 'puffin', Puffin: 'puffin',
QupZilla: 'qupzilla', QupZilla: 'qupzilla',
QQ: 'qq',
QQLite: 'qqlite',
Safari: 'safari', Safari: 'safari',
Sailfish: 'sailfish', Sailfish: 'sailfish',
'Samsung Internet for Android': 'samsung_internet', 'Samsung Internet for Android': 'samsung_internet',
@ -45,11 +50,13 @@ export const BROWSER_MAP = {
blackberry: 'BlackBerry', blackberry: 'BlackBerry',
chrome: 'Chrome', chrome: 'Chrome',
chromium: 'Chromium', chromium: 'Chromium',
electron: 'Electron',
epiphany: 'Epiphany', epiphany: 'Epiphany',
firefox: 'Firefox', firefox: 'Firefox',
focus: 'Focus', focus: 'Focus',
generic: 'Generic', generic: 'Generic',
googlebot: 'Googlebot', googlebot: 'Googlebot',
google_search: 'Google Search',
ie: 'Internet Explorer', ie: 'Internet Explorer',
k_meleon: 'K-Meleon', k_meleon: 'K-Meleon',
maxthon: 'Maxthon', maxthon: 'Maxthon',
@ -58,9 +65,12 @@ export const BROWSER_MAP = {
naver: 'NAVER Whale Browser', naver: 'NAVER Whale Browser',
opera: 'Opera', opera: 'Opera',
opera_coast: 'Opera Coast', opera_coast: 'Opera Coast',
pale_moon: 'Pale Moon',
phantomjs: 'PhantomJS', phantomjs: 'PhantomJS',
puffin: 'Puffin', puffin: 'Puffin',
qupzilla: 'QupZilla', qupzilla: 'QupZilla',
qq: 'QQ Browser',
qqlite: 'QQ Browser Lite',
safari: 'Safari', safari: 'Safari',
sailfish: 'Sailfish', sailfish: 'Sailfish',
samsung_internet: 'Samsung Internet for Android', samsung_internet: 'Samsung Internet for Android',
@ -80,6 +90,7 @@ export const PLATFORMS_MAP = {
mobile: 'mobile', mobile: 'mobile',
desktop: 'desktop', desktop: 'desktop',
tv: 'tv', tv: 'tv',
bot: 'bot',
}; };
export const OS_MAP = { export const OS_MAP = {

View File

@ -108,6 +108,21 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/PaleMoon/i],
describe(ua) {
const browser = {
name: 'Pale Moon',
};
const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{ {
test: [/MZBrowser/i], test: [/MZBrowser/i],
describe(ua) { describe(ua) {
@ -168,6 +183,21 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/opt\/\d+(?:.?_?\d+)+/i],
describe(ua) {
const browser = {
name: 'Opera Touch',
};
const version = Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{ {
test: [/yabrowser/i], test: [/yabrowser/i],
describe(ua) { describe(ua) {
@ -288,6 +318,21 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/qqbrowser/i],
describe(ua) {
const browser = {
name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser',
};
const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{ {
test: [/msie|trident/i], test: [/msie|trident/i],
describe(ua) { describe(ua) {
@ -516,6 +561,36 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/electron/i],
describe(ua) {
const browser = {
name: 'Electron',
};
const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{
test: [/MiuiBrowser/i],
describe(ua) {
const browser = {
name: 'Miui',
};
const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{ {
test: [/chromium/i], test: [/chromium/i],
describe(ua) { describe(ua) {
@ -546,6 +621,21 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/GSA/i],
describe(ua) {
const browser = {
name: 'Google Search',
};
const version = Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
/* Android Browser */ /* Android Browser */
{ {

View File

@ -28,7 +28,7 @@ export default [
/* Windows */ /* Windows */
{ {
test: [/windows/i], test: [/windows /i],
describe(ua) { describe(ua) {
const version = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua); const version = Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua);
const versionName = Utils.getWindowsVersionName(version); const versionName = Utils.getWindowsVersionName(version);
@ -41,6 +41,21 @@ export default [
}, },
}, },
/* Firefox on iPad */
{
test: [/Macintosh(.*?) FxiOS(.*?)\//],
describe(ua) {
const result = {
name: OS_MAP.iOS,
};
const version = Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/, ua);
if (version) {
result.version = version;
}
return result;
},
},
/* macOS */ /* macOS */
{ {
test: [/macintosh/i], test: [/macintosh/i],

View File

@ -12,7 +12,7 @@ export default [
test: [/googlebot/i], test: [/googlebot/i],
describe() { describe() {
return { return {
type: 'bot', type: PLATFORMS_MAP.bot,
vendor: 'Google', vendor: 'Google',
}; };
}, },
@ -57,6 +57,18 @@ export default [
}, },
}, },
/* Firefox on iPad */
{
test: [/Macintosh(.*?) FxiOS(.*?)\//],
describe() {
return {
type: PLATFORMS_MAP.tablet,
vendor: 'Apple',
model: 'iPad',
};
},
},
/* Amazon Kindle Fire */ /* Amazon Kindle Fire */
{ {
test: [/kftt build/i], test: [/kftt build/i],
@ -82,7 +94,7 @@ export default [
/* Tablet */ /* Tablet */
{ {
test: [/tablet/i], test: [/tablet(?! pc)/i],
describe() { describe() {
return { return {
type: PLATFORMS_MAP.tablet, type: PLATFORMS_MAP.tablet,
@ -118,6 +130,22 @@ export default [
}, },
}, },
/* Nokia */
{
test: [/Nokia/i],
describe(ua) {
const model = Utils.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i, ua);
const platform = {
type: PLATFORMS_MAP.mobile,
vendor: 'Nokia',
};
if (model) {
platform.model = model;
}
return platform;
},
},
/* Mobile */ /* Mobile */
{ {
test: [/[^-]mobi/i], test: [/[^-]mobi/i],

View File

@ -82,12 +82,12 @@ class Parser {
parseBrowser() { parseBrowser() {
this.parsedResult.browser = {}; this.parsedResult.browser = {};
const browserDescriptor = browserParsersList.find((_browser) => { const browserDescriptor = Utils.find(browserParsersList, (_browser) => {
if (typeof _browser.test === 'function') { if (typeof _browser.test === 'function') {
return _browser.test(this); return _browser.test(this);
} }
if (_browser.test instanceof Array) { if (Array.isArray(_browser.test)) {
return _browser.test.some(condition => this.test(condition)); return _browser.test.some(condition => this.test(condition));
} }
@ -165,12 +165,12 @@ class Parser {
parseOS() { parseOS() {
this.parsedResult.os = {}; this.parsedResult.os = {};
const os = osParsersList.find((_os) => { const os = Utils.find(osParsersList, (_os) => {
if (typeof _os.test === 'function') { if (typeof _os.test === 'function') {
return _os.test(this); return _os.test(this);
} }
if (_os.test instanceof Array) { if (Array.isArray(_os.test)) {
return _os.test.some(condition => this.test(condition)); return _os.test.some(condition => this.test(condition));
} }
@ -241,12 +241,12 @@ class Parser {
parsePlatform() { parsePlatform() {
this.parsedResult.platform = {}; this.parsedResult.platform = {};
const platform = platformParsersList.find((_platform) => { const platform = Utils.find(platformParsersList, (_platform) => {
if (typeof _platform.test === 'function') { if (typeof _platform.test === 'function') {
return _platform.test(this); return _platform.test(this);
} }
if (_platform.test instanceof Array) { if (Array.isArray(_platform.test)) {
return _platform.test.some(condition => this.test(condition)); return _platform.test.some(condition => this.test(condition));
} }
@ -292,12 +292,12 @@ class Parser {
parseEngine() { parseEngine() {
this.parsedResult.engine = {}; this.parsedResult.engine = {};
const engine = enginesParsersList.find((_engine) => { const engine = Utils.find(enginesParsersList, (_engine) => {
if (typeof _engine.test === 'function') { if (typeof _engine.test === 'function') {
return _engine.test(this); return _engine.test(this);
} }
if (_engine.test instanceof Array) { if (Array.isArray(_engine.test)) {
return _engine.test.some(condition => this.test(condition)); return _engine.test.some(condition => this.test(condition));
} }
@ -313,6 +313,7 @@ class Parser {
/** /**
* Parse full information about the browser * Parse full information about the browser
* @returns {Parser}
*/ */
parse() { parse() {
this.parseBrowser(); this.parseBrowser();
@ -328,7 +329,7 @@ class Parser {
* @return {ParsedResult} * @return {ParsedResult}
*/ */
getResult() { getResult() {
return Object.assign({}, this.parsedResult); return Utils.assign({}, this.parsedResult);
} }
/** /**
@ -370,7 +371,7 @@ class Parser {
if (platformsAndOSCounter > 0) { if (platformsAndOSCounter > 0) {
const platformsAndOSNames = Object.keys(platformsAndOSes); const platformsAndOSNames = Object.keys(platformsAndOSes);
const OSMatchingDefinition = platformsAndOSNames.find(name => (this.isOS(name))); const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name)));
if (OSMatchingDefinition) { if (OSMatchingDefinition) {
const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]); const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);
@ -380,7 +381,10 @@ class Parser {
} }
} }
const platformMatchingDefinition = platformsAndOSNames.find(name => (this.isPlatform(name))); const platformMatchingDefinition = Utils.find(
platformsAndOSNames,
name => (this.isPlatform(name)),
);
if (platformMatchingDefinition) { if (platformMatchingDefinition) {
const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]); const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);
@ -392,7 +396,7 @@ class Parser {
if (browsersCounter > 0) { if (browsersCounter > 0) {
const browserNames = Object.keys(browsers); const browserNames = Object.keys(browsers);
const matchingDefinition = browserNames.find(name => (this.isBrowser(name, true))); const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true)));
if (matchingDefinition !== void 0) { if (matchingDefinition !== void 0) {
return this.compareVersion(browsers[matchingDefinition]); return this.compareVersion(browsers[matchingDefinition]);
@ -404,7 +408,7 @@ class Parser {
/** /**
* Check if the browser name equals the passed string * Check if the browser name equals the passed string
* @param browserName The string to compare with the browser name * @param {string} browserName The string to compare with the browser name
* @param [includingAlias=false] The flag showing whether alias will be included into comparison * @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {boolean} * @returns {boolean}
*/ */
@ -455,14 +459,29 @@ class Parser {
) > -1; ) > -1;
} }
/**
* Check if the OS name equals the passed string
* @param {string} osName The string to compare with the OS name
* @returns {boolean}
*/
isOS(osName) { isOS(osName) {
return this.getOSName(true) === String(osName).toLowerCase(); return this.getOSName(true) === String(osName).toLowerCase();
} }
/**
* Check if the platform type equals the passed string
* @param {string} platformType The string to compare with the platform type
* @returns {boolean}
*/
isPlatform(platformType) { isPlatform(platformType) {
return this.getPlatformType(true) === String(platformType).toLowerCase(); return this.getPlatformType(true) === String(platformType).toLowerCase();
} }
/**
* Check if the engine name equals the passed string
* @param {string} engineName The string to compare with the engine name
* @returns {boolean}
*/
isEngine(engineName) { isEngine(engineName) {
return this.getEngineName(true) === String(engineName).toLowerCase(); return this.getEngineName(true) === String(engineName).toLowerCase();
} }
@ -471,10 +490,12 @@ class Parser {
* Is anything? Check if the browser is called "anything", * Is anything? Check if the browser is called "anything",
* the OS called "anything" or the platform called "anything" * the OS called "anything" or the platform called "anything"
* @param {String} anything * @param {String} anything
* @param [includingAlias=false] The flag showing whether alias will be included into comparison
* @returns {Boolean} * @returns {Boolean}
*/ */
is(anything) { is(anything, includingAlias = false) {
return this.isBrowser(anything) || this.isOS(anything) || this.isPlatform(anything); return this.isBrowser(anything, includingAlias) || this.isOS(anything)
|| this.isPlatform(anything);
} }
/** /**

View File

@ -210,6 +210,8 @@ export default class Utils {
return -1; return -1;
} }
} }
return undefined;
} }
/** /**
@ -231,6 +233,54 @@ export default class Utils {
return result; return result;
} }
/**
* Array::find polyfill
*
* @param {Array} arr
* @param {Function} predicate
* @return {Array}
*/
static find(arr, predicate) {
let i;
let l;
if (Array.prototype.find) {
return Array.prototype.find.call(arr, predicate);
}
for (i = 0, l = arr.length; i < l; i += 1) {
const value = arr[i];
if (predicate(value, i)) {
return value;
}
}
return undefined;
}
/**
* Object::assign polyfill
*
* @param {Object} obj
* @param {Object} ...objs
* @return {Object}
*/
static assign(obj, ...assigners) {
const result = obj;
let i;
let l;
if (Object.assign) {
return Object.assign(obj, ...assigners);
}
for (i = 0, l = assigners.length; i < l; i += 1) {
const assigner = assigners[i];
if (typeof assigner === 'object' && assigner !== null) {
const keys = Object.keys(assigner);
keys.forEach((key) => {
result[key] = assigner[key];
});
}
}
return obj;
}
/** /**
* Get short version/alias for a browser name * Get short version/alias for a browser name
* *
@ -245,15 +295,15 @@ export default class Utils {
} }
/** /**
* Get short version/alias for a browser name * Get browser name for a short version/alias
* *
* @example * @example
* getBrowserAlias('edge') // Microsoft Edge * getBrowserTypeByAlias('edge') // Microsoft Edge
* *
* @param {string} browserName * @param {string} browserAlias
* @return {string} * @return {string}
*/ */
static getBrowserTypeByAlias(browserAlia) { static getBrowserTypeByAlias(browserAlias) {
return BROWSER_MAP[browserAlia] || ''; return BROWSER_MAP[browserAlias] || '';
} }
} }

View File

@ -336,6 +336,52 @@
type: "tv" type: "tv"
engine: engine:
name: "Blink" name: "Blink"
-
ua: "Mozilla/5.0 (Linux; Android 9; Nokia 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.127 Mobile Safari/537.36"
spec:
browser:
name: "Chrome"
version: "85.0.4183.127"
os:
name: "Android"
version: "9"
versionName: "Pie"
platform:
type: "mobile"
vendor: "Nokia"
model: "5.1"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Linux; Android 10; SM-G970F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3396.81 Mobile Safari/537.36"
spec:
browser:
name: "Chrome"
version: "75.0.3396.81"
os:
name: "Android"
version: "10"
platform:
type: "mobile"
engine:
name: "Blink"
Google Search:
-
ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/83.0.268992909 Mobile/15E148 Safari/605.1"
spec:
browser:
name: "Google Search"
version: "83.0.268992909"
os:
name: "iOS"
version: "12.4"
platform:
type: "mobile"
vendor: "Apple"
model: "iPhone"
engine:
name: "WebKit"
version: "605.1.15"
Amazon Silk: Amazon Silk:
- -
ua: "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true" ua: "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true"
@ -673,6 +719,21 @@
engine: engine:
name: "WebKit" name: "WebKit"
version: "601.1.46" version: "601.1.46"
Opera Touch:
-
ua: "Mozilla/5.0 (Linux; Android 7.0; SM-A520F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 OPT/1.0.9"
spec:
browser:
name: "Opera Touch"
version: "1.0.9"
os:
name: "Android"
version: "7.0"
versionName: 'Nougat'
platform:
type: "mobile"
engine:
name: "Blink"
Yandex Browser: Yandex Browser:
- -
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3420 (beta) Yowser/2.0 Safari/537.36" ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3420 (beta) Yowser/2.0 Safari/537.36"
@ -1359,6 +1420,7 @@
version: "8.0" version: "8.0"
platform: platform:
type: "mobile" type: "mobile"
vendor: "Nokia"
engine: engine:
name: "Trident" name: "Trident"
version: "6.0" version: "6.0"
@ -1373,6 +1435,7 @@
version: "8.0" version: "8.0"
platform: platform:
type: "mobile" type: "mobile"
vendor: "Nokia"
engine: engine:
name: "Trident" name: "Trident"
version: "6.0" version: "6.0"
@ -1401,6 +1464,7 @@
version: "7.0" version: "7.0"
platform: platform:
type: "mobile" type: "mobile"
vendor: "Nokia"
engine: engine:
name: "Trident" name: "Trident"
version: "3.1" version: "3.1"
@ -1418,6 +1482,21 @@
engine: engine:
name: "Trident" name: "Trident"
version: "7.0" version: "7.0"
-
ua: "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; Zoom 3.6.0; InfoPath.3; rv:11.0) like Gecko"
spec:
browser:
name: "Internet Explorer"
version: "11.0"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Trident"
version: "7.0"
Microsoft Edge: Microsoft Edge:
- -
ua: 'Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1' ua: 'Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1'
@ -1791,6 +1870,37 @@
engine: engine:
name: "Gecko" name: "Gecko"
version: "20100101" version: "20100101"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/21.0 Version/13.0.3 Safari/605.1.15"
spec:
browser:
name: "Firefox"
version: "21.0"
os:
name: "iOS"
version: "13.0.3"
platform:
type: "tablet"
vendor: "Apple"
model: "iPad"
engine:
name: "WebKit"
version: "605.1.15"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/24.1 Safari/605.1.15"
spec:
browser:
name: "Firefox"
version: "24.1"
os:
name: "iOS"
platform:
type: "tablet"
vendor: "Apple"
model: "iPad"
engine:
name: "WebKit"
version: "605.1.15"
SeaMonkey: SeaMonkey:
- -
ua: "Mozilla/5.0 (Windows NT 5.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1" ua: "Mozilla/5.0 (Windows NT 5.2; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 SeaMonkey/2.7.1"
@ -2473,6 +2583,22 @@
engine: engine:
name: "WebKit" name: "WebKit"
version: "537.51.1" version: "537.51.1"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat"
spec:
browser:
name: "WeChat"
version: "6.5.2.501"
os:
name: "macOS"
version: "10.15.1"
versionName: "Catalina"
platform:
type: "desktop"
vendor: "Apple"
engine:
name: "WebKit"
version: "605.1.15"
UC Browser: UC Browser:
- -
ua: "Mozilla/5.0 (iPad; U; CPU OS 9 like Mac OS X; en-us; iPad4,4) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/2.4.0.367 U3/1 Safari/7543.48.3" ua: "Mozilla/5.0 (iPad; U; CPU OS 9 like Mac OS X; en-us; iPad4,4) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/2.4.0.367 U3/1 Safari/7543.48.3"
@ -2784,3 +2910,208 @@
platform: platform:
type: "tv" type: "tv"
engine: {} engine: {}
QQ Browser:
-
ua: "Mozilla/5.0 (Linux; U; Android 4.4.2; zh-cn; GT-I9500 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 MQQBrowser/5.0 QQ-URL-Manager Mobile Safari/537.36"
spec:
browser:
name: "QQ Browser"
version: "5.0"
os:
name: "Android"
version: "4.4.2"
versionName: "KitKat"
platform:
type: "mobile"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (iPhone 84; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 MQQBrowser/7.8.0 Mobile/14G60 Safari/8536.25 MttCustomUA/2 QBWebViewType/1 WKType/1"
spec:
browser:
name: "QQ Browser"
version: "7.8.0"
os:
name: "iOS"
version: "10.3.3"
platform:
model: "iPhone"
type: "mobile"
vendor: "Apple"
engine:
name: "WebKit"
version: "603.3.8"
-
ua: "Mozilla/5.0 (Linux; U; Android 9; zh-cn; DUK-AL20 Build/HUAWEIDUK-AL20) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/9.6 Mobile Safari/537.36"
spec:
browser:
name: "QQ Browser"
version: "9.6"
os:
name: "Android"
version: "9"
versionName: "Pie"
platform:
type: "mobile"
vendor: "Huawei"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2141.400 QQBrowser/9.5.10219.400"
spec:
browser:
name: "QQ Browser"
version: "9.5.10219.400"
os:
name: "Windows"
version: "NT 6.1"
versionName: "7"
platform:
type: "desktop"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36 QQBrowser/3.8.3858.400"
spec:
browser:
name: "QQ Browser"
version: "3.8.3858.400"
os:
name: "macOS"
version: "10.10.5"
versionName: "Yosemite"
platform:
type: "desktop"
vendor: "Apple"
engine:
name: "Blink"
QQ Browser Lite:
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.3 Safari/605.1.15 QQBrowserLite/1.2.5"
spec:
browser:
name: "QQ Browser Lite"
version: "1.2.5"
os:
name: "macOS"
version: "10.13.6"
versionName: "High Sierra"
platform:
type: "desktop"
vendor: "Apple"
engine:
name: "WebKit"
version: "605.1.15"
Electron:
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) my-app/1.0.0 Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Electron/6.1.5 Safari/537.36"
spec:
browser:
name: "Electron"
version: "6.1.5"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "macOS"
version: "10.15.1"
versionName: "Catalina"
platform:
type: "desktop"
vendor: 'Apple'
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "Linux"
platform:
type: "desktop"
engine:
name: "Blink"
Miui:
-
ua: "Mozilla/5.0 (Linux; U; Android 9; fr-fr; Redmi Note 8 Pro Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/11.9.3-"
spec:
browser:
name: "Miui"
version: "11.9.3"
os:
name: "Android"
version: "9"
versionName: "Pie"
platform:
type: "mobile"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Linux; U; Android 9; fr-fr; Redmi Note 8 Pro Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser"
spec:
browser:
name: "Miui"
os:
name: "Android"
version: "9"
versionName: "Pie"
platform:
type: "mobile"
engine:
name: "Blink"
Pale Moon:
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.1.1"
spec:
browser:
name: "Pale Moon"
version: "29.1.1"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Gecko"
version: "20100101"
-
ua: "Mozilla/5.0 (X11; Linux i686; rv:45.9) Gecko/20100101 Goanna/3.2 Firefox/45.9 PaleMoon/27.2.0"
spec:
browser:
name: "Pale Moon"
version: "27.2.0"
os:
name: "Linux"
platform:
type: "desktop"
engine:
name: "Gecko"
version: "20100101"

View File

@ -165,6 +165,30 @@ test('Parser.is should pass', (t) => {
t.is(parser.is('macos'), true); t.is(parser.is('macos'), true);
}); });
test('Parser.is should pass when not including aliases', (t) => {
t.is(edgeParser.is('Microsoft Edge', false), true);
t.is(edgeParser.is('microsoft edge', false), true);
t.is(edgeParser.is('mIcrosoft eDge', false), true);
t.is(edgeParser.is('edge', false), false);
t.is(edgeParser.is('Edge', false), false);
t.is(edgeParser.is('desktop', false), false);
t.is(edgeParser.is('macos', false), false);
t.is(edgeParser.is('mobile', false), true);
t.is(edgeParser.is('android', false), true);
});
test('Parser.is should pass when including aliases', (t) => {
t.is(edgeParser.is('Microsoft Edge', true), true);
t.is(edgeParser.is('microsoft edge', true), true);
t.is(edgeParser.is('mIcrosoft eDge', true), true);
t.is(edgeParser.is('edge', true), true);
t.is(edgeParser.is('Edge', true), true);
t.is(edgeParser.is('desktop', true), false);
t.is(edgeParser.is('macos', true), false);
t.is(edgeParser.is('mobile', true), true);
t.is(edgeParser.is('android', true), true);
});
test('Parser.is using constants should pass', (t) => { test('Parser.is using constants should pass', (t) => {
t.is(parser.is(Bowser.BROWSER_MAP.opera), true); t.is(parser.is(Bowser.BROWSER_MAP.opera), true);
t.is(parser.is(Bowser.PLATFORMS_MAP.desktop), true); t.is(parser.is(Bowser.PLATFORMS_MAP.desktop), true);
@ -199,3 +223,8 @@ test('Parser.isBrowser should pass for non-aliased browsers', (t) => {
t.is(focusParser.isBrowser('Focus', true), true); t.is(focusParser.isBrowser('Focus', true), true);
t.is(focusParser.isBrowser('Focus', false), true); t.is(focusParser.isBrowser('Focus', false), true);
}); });
test('Parser.isEngine should pass', (t) => {
t.is(parser.isEngine('blink'), true);
t.is(parser.isEngine('webkit'), false);
});

View File

@ -1,11 +1,18 @@
import test from 'ava'; import test from 'ava';
import { import {
getBrowserAlias,
getFirstMatch, getFirstMatch,
getSecondMatch,
matchAndReturnConst,
getWindowsVersionName, getWindowsVersionName,
getMacOSVersionName, getMacOSVersionName,
getAndroidVersionName, getAndroidVersionName,
getVersionPrecision,
compareVersions, compareVersions,
map,
find,
assign,
getBrowserAlias,
getBrowserTypeByAlias
} from '../../src/utils'; } from '../../src/utils';
test('getFirstMatch', (t) => { test('getFirstMatch', (t) => {
@ -13,6 +20,16 @@ test('getFirstMatch', (t) => {
t.is(matchedVersion, '11.11.11'); t.is(matchedVersion, '11.11.11');
}); });
test('getSecondMatch', (t) => {
const matchedVersion = getSecondMatch(/version\/(\S+).*version\/(\S+)/i, 'Chrome Version/11.11.11 Chrome Version/22.22.22');
t.is(matchedVersion, '22.22.22');
});
test('matchAndReturnConst', (t) => {
const _const = matchAndReturnConst(/version/i, 'version', "_const");
t.is(_const, '_const');
});
test('getWindowsVersionName', (t) => { test('getWindowsVersionName', (t) => {
t.is(getWindowsVersionName('NT 5.0'), '2000'); t.is(getWindowsVersionName('NT 5.0'), '2000');
t.is(getWindowsVersionName('XXX'), void 0); t.is(getWindowsVersionName('XXX'), void 0);
@ -32,6 +49,11 @@ test('getAndroidVersionName', (t) => {
t.is(getAndroidVersionName('XXX'), void 0); t.is(getAndroidVersionName('XXX'), void 0);
}); });
test('getVersionPrecision', (t) => {
const precision = getVersionPrecision("10.14.5");
t.is(precision, 3);
});
test('compareVersions', (t) => { test('compareVersions', (t) => {
const comparisionsTasks = [ const comparisionsTasks = [
['9.0', '10', -1], ['9.0', '10', -1],
@ -68,7 +90,51 @@ test('compareVersions', (t) => {
}); });
}); });
test('map', (t) => {
const result = map([1,2], (value) => value+2);
t.is(result[0], 3);
t.is(result[1], 4);
const original = Array.prototype.map;
delete Array.prototype.map;
const polyfillResult = map([1,2], (value) => value+2);
Array.prototype.map = original;
t.is(polyfillResult[0], 3);
t.is(polyfillResult[1], 4);
});
test('find', (t) => {
const result = find([1,2], (value) => value==2);
t.is(result, 2);
const original = Array.prototype.find;
delete Array.prototype.find;
const polyfillResultFound = find([1,2], (value) => value==2);
const polyfillResultNotFound = find([1,2], (value) => value==3);
Array.prototype.find = original;
t.is(polyfillResultFound, 2);
t.is(polyfillResultNotFound, undefined);
});
test('assign', (t) => {
const result = assign({}, { a: 1 }, { b: 1 }, { b: 2, c: 3 });
t.is(result['a'], 1);
t.is(result['b'], 2);
t.is(result['c'], 3);
const original = Object.assign;
delete Object.assign;
const polyfillResult = assign({}, { a: 1 }, { b: 1 }, null, { b: 2, c: 3 });
Object.assign = original;
t.is(polyfillResult['a'], 1);
t.is(polyfillResult['b'], 2);
t.is(polyfillResult['c'], 3);
});
test('getBrowserAlias', (t) => { test('getBrowserAlias', (t) => {
t.is(getBrowserAlias('Microsoft Edge'), 'edge'); t.is(getBrowserAlias('Microsoft Edge'), 'edge');
t.is(getBrowserAlias('Unexisting Browser'), void 0); t.is(getBrowserAlias('Unexisting Browser'), void 0);
}); });
test('getBrowserTypeByAlias', (t) => {
t.is(getBrowserTypeByAlias('edge'), 'Microsoft Edge');
t.is(getBrowserTypeByAlias(void 0), '');
});