Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 88b1723

Browse files
committed
Merge pull request #2 from SomeoneWeird/florida-blacklist
Add florida to blacklist
2 parents b96df60 + 8b8eeff commit 88b1723

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

filter-aussies.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ const AU_LOCATION_REGEX =
22
/\Wau(s|st)?\W|australia|straya|hobart|sydney|melbourne|brisbane|perth|darwin|adelaide|canberra|\W(nsw|vic|qld|new south wales|victoria|queensland|western australia|northern territory|south australia|tasmania)\W/i
33
// secondary guess, does your blog UI end with .au?
44
, AU_BLOG_REGEX = /\.au$/i
5+
, AU_BLACKLIST_REGEX = /fl|florida/i
56

67
function isAussie (user) {
78
if (!user) return false
8-
if (user.location && AU_LOCATION_REGEX.test(user.location)) return true
9+
if (user.location && AU_LOCATION_REGEX.test(user.location) && !AU_BLACKLIST_REGEX.test(user.location)) return true
910
if (user.blog && AU_BLOG_REGEX.test(user.blog)) return true
1011
return false
1112
}

0 commit comments

Comments
 (0)