refactor: isModernBrowser return boolean for avoiding duplicate call

This commit is contained in:
Clark Du 2019-02-14 14:01:30 +00:00
parent 2b4d79c199
commit c6d8e8ff66

View File

@ -20,7 +20,7 @@ const isModernBrowser = (ua) => {
if (!browserVersion) {
return false
}
return modernBrowsers[browser.name] && semver.gte(browserVersion, modernBrowsers[browser.name])
return Boolean(modernBrowsers[browser.name] && semver.gte(browserVersion, modernBrowsers[browser.name]))
}
let detected = false