1
0
mirror of https://github.com/lancedikson/bowser synced 2026-03-02 03:40:27 +00:00

Throw an error when minVersion map has not a string as a browser version

fixes #165
This commit is contained in:
Denis Demchenko
2016-10-31 11:07:15 +02:00
parent 533afc8fec
commit 8b92707e7b
2 changed files with 10 additions and 0 deletions

View File

@@ -540,6 +540,10 @@
for (var browser in minVersions) {
if (minVersions.hasOwnProperty(browser)) {
if (_bowser[browser]) {
if (typeof minVersions[browser] !== 'string') {
throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions));
}
// browser version and min supported version.
return compareVersions([version, minVersions[browser]]) < 0;
}