From b002d70070a1b691b635220bc694c48df36faca5 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 6 May 2019 22:17:01 +0900 Subject: src/content --- src/background/usecases/filters.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/background/usecases/filters.ts') diff --git a/src/background/usecases/filters.ts b/src/background/usecases/filters.ts index 44eb56f..84a42fb 100644 --- a/src/background/usecases/filters.ts +++ b/src/background/usecases/filters.ts @@ -40,7 +40,8 @@ const filterByPathname = (items: Item[], min: number): Item[] => { let pathname = url.origin + url.pathname; if (!hash[pathname]) { hash[pathname] = item; - } else if (hash[pathname].url.length > item.url.length) { + } else if ((hash[pathname].url as string).length > + (item.url as string).length) { hash[pathname] = item; } } @@ -57,7 +58,8 @@ const filterByOrigin = (items: Item[], min: number): Item[] => { let origin = new URL(item.url as string).origin; if (!hash[origin]) { hash[origin] = item; - } else if (hash[origin].url.length > item.url.length) { + } else if ((hash[origin].url as string).length > + (item.url as string).length) { hash[origin] = item; } } -- cgit v1.2.3