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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user