aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/filters.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-06 22:17:01 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-06 22:17:18 +0900
commitb002d70070a1b691b635220bc694c48df36faca5 (patch)
treefd69cc7a74e30c33f33376acf7e36ce585c819d9 /src/background/usecases/filters.ts
parenta0882bbceb7ed71d56bf8557620449fbc3f19749 (diff)
src/content
Diffstat (limited to 'src/background/usecases/filters.ts')
-rw-r--r--src/background/usecases/filters.ts6
1 files changed, 4 insertions, 2 deletions
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;
}
}