A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
316 B
14 lines
316 B
6 years ago
|
import * as re from 'shared/utils/re';
|
||
|
|
||
|
const includes = (blacklist, url) => {
|
||
6 years ago
|
let u = new URL(url);
|
||
6 years ago
|
return blacklist.some((item) => {
|
||
|
if (!item.includes('/')) {
|
||
6 years ago
|
return re.fromWildcard(item).test(u.host);
|
||
6 years ago
|
}
|
||
6 years ago
|
return re.fromWildcard(item).test(u.host + u.pathname);
|
||
6 years ago
|
});
|
||
6 years ago
|
};
|
||
6 years ago
|
|
||
|
export { includes };
|