@qctrl/website-validator
Version:
Q-CTRL Website Validator provides a set of utility tools that validate HTML pages and hyperlinks.
19 lines (18 loc) • 490 B
JavaScript
/**
* Check to see if the given url is ignored based on ignore list
*
* @param url - Url to check
* @param ignoreList - List of urls to ignore
*
* @returns if the url should be ignored
*/
export default function isUrlIgnored(url, ignoreList) {
for (let index = 0; index < ignoreList.length; index += 1) {
const element = ignoreList[index];
const regex = RegExp(element);
if (regex.test(url)) {
return true;
}
}
return false;
}