From c6d8e8ff66ae43eda5b412b280800c9cdcd2e699 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 14 Feb 2019 14:01:30 +0000 Subject: [PATCH] refactor: isModernBrowser return boolean for avoiding duplicate call --- packages/server/src/middleware/modern.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/middleware/modern.js b/packages/server/src/middleware/modern.js index c1be269f17..97976f56e9 100644 --- a/packages/server/src/middleware/modern.js +++ b/packages/server/src/middleware/modern.js @@ -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