From 84e09b676144a4e153ab1b1aabc0cb36521817db Mon Sep 17 00:00:00 2001 From: adrianaixba Date: Fri, 28 Aug 2020 15:40:19 -0500 Subject: [PATCH] clean up --- lighthouse-core/audits/service-worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/audits/service-worker.js b/lighthouse-core/audits/service-worker.js index 25d4e4d694c9..a09cf3f64349 100644 --- a/lighthouse-core/audits/service-worker.js +++ b/lighthouse-core/audits/service-worker.js @@ -77,7 +77,7 @@ class ServiceWorker extends Audit { */ static getControllingServiceWorker(matchingSWVersions, registrations, pageUrl) { // Find the normalized scope URLs of possibly-controlling SWs. - /** @type {Array<{ scopeUrl: string; scriptUrl: string;}>} */ + /** @type {Array<{scopeUrl: string; scriptUrl: string}>} */ const scriptByScopeUrlList = []; // Populate serviceWorkerUrls map with the scriptURLs and scopeUrls of matchingSWVersions and registrations @@ -95,8 +95,8 @@ class ServiceWorker extends Audit { // Find most-specific applicable scope, the one controlling the page. // See https://w3c.github.io/ServiceWorker/v1/#scope-match-algorithm const pageControllingUrls = scriptByScopeUrlList - .filter(urlPair => pageUrl.href.startsWith(urlPair.scopeUrl.toString())) - .sort((scopeA, scopeB) => scopeA.scopeUrl.length - scopeB.scopeUrl.length) + .filter(ss => pageUrl.href.startsWith(ss.scopeUrl)) + .sort((ssA, ssB) => ssA.scopeUrl.length - ssB.scopeUrl.length) .pop(); return pageControllingUrls;