Rename .js/.jsx to .ts/.tsx
This commit is contained in:
parent
257162e5b6
commit
c60d0e7392
151 changed files with 0 additions and 0 deletions
13
src/shared/blacklists.ts
Normal file
13
src/shared/blacklists.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import * as re from 'shared/utils/re';
|
||||
|
||||
const includes = (blacklist, url) => {
|
||||
let u = new URL(url);
|
||||
return blacklist.some((item) => {
|
||||
if (!item.includes('/')) {
|
||||
return re.fromWildcard(item).test(u.host);
|
||||
}
|
||||
return re.fromWildcard(item).test(u.host + u.pathname);
|
||||
});
|
||||
};
|
||||
|
||||
export { includes };
|
Reference in a new issue