Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change var to const #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var util = require('./util'),
dataset = require('./dataset');
/* HEADER END */

var msiePattern = /MSIE ([.0-9]+);/;
var tridentPattern = /Trident\/[.0-9]+;/;
var tridentVersionPattern = / rv:([.0-9]+)/;
var iemobilePattern = /IEMobile\/([.0-9]+);/;
const msiePattern = /MSIE ([.0-9]+);/;
const tridentPattern = /Trident\/[.0-9]+;/;
const tridentVersionPattern = / rv:([.0-9]+)/;
const iemobilePattern = /IEMobile\/([.0-9]+);/;
var challengeMSIE = exports.challengeMSIE = function(ua, result) {
if (ua.indexOf('compatible; MSIE') < 0 && ua.indexOf('Trident/') < 0 && ua.indexOf('IEMobile/'))
return false;
Expand All @@ -32,7 +32,7 @@ var challengeMSIE = exports.challengeMSIE = function(ua, result) {
return true;
};

var yandexBrowserPattern = /YaBrowser\/([.0-9]+)/;
const yandexBrowserPattern = /YaBrowser\/([.0-9]+)/;
var challengeYandexBrowser = exports.challengeYandexBrowser = function(ua, result) {
if (ua.indexOf('YaBrowser/') < 0)
return false;
Expand All @@ -49,12 +49,13 @@ var challengeYandexBrowser = exports.challengeYandexBrowser = function(ua, resul
return true;
};

var edgePattern = /(?:Edge|Edg|EdgiOS|EdgA)\/([.0-9]+)/;
var firefoxiOSPattern = /FxiOS\/([.0-9]+)/;
var chromePattern = /(?:Chrome|CrMo|CriOS)\/([.0-9]+)/;
var operaBlinkPattern = /OPR\/([.0-9]+)/;
var gsaPattern = /GSA\/([.0-9]+)/;
var safariPattern = /Version\/([.0-9]+)/;
const edgePattern = /(?:Edge|Edg|EdgiOS|EdgA)\/([.0-9]+)/;
const firefoxiOSPattern = /FxiOS\/([.0-9]+)/;
const chromePattern = /(?:Chrome|CrMo|CriOS)\/([.0-9]+)/;
const operaBlinkPattern = /OPR\/([.0-9]+)/;
const gsaPattern = /GSA\/([.0-9]+)/;
const safariPattern = /Version\/([.0-9]+)/;

var challengeSafariChrome = exports.challengeSafariChrome = function(ua, result) {
if (ua.indexOf('Safari/') < 0)
return false;
Expand Down Expand Up @@ -202,7 +203,7 @@ var challengeSleipnir = exports.challengeSleipnir = function(ua, result) {
return true;
};

var vivaldiPattern = /Vivaldi\/([.0-9]+)/;
const vivaldiPattern = /Vivaldi\/([.0-9]+)/;
var challengeVivaldi = exports.challengeVivaldi = function(ua, result) {
if (ua.indexOf('Vivaldi/') < 0)
return false;
Expand Down