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

fix regexp selection order

This commit is contained in:
Ricardo Rauber Pereira 2019-04-23 10:40:04 +01:00
parent 2dcfca1388
commit b8d60f7593

View File

@ -597,7 +597,7 @@ const browsersList = [
const regexpWithoutDeviceSpec = /^(.*)\/(.*) /;
const regexpWithDeviceSpec = /^(.*)\/(.*)[ \t]\((.*)/;
const hasDeviceSpec = ua.search('\\(') !== -1;
const regexp = hasDeviceSpec ? regexpWithoutDeviceSpec : regexpWithDeviceSpec;
const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;
return {
name: Utils.getFirstMatch(regexp, ua),
version: Utils.getSecondMatch(regexp, ua),