You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
378 B
JavaScript
12 lines
378 B
JavaScript
export default function scoreBaseUrl(href, baseRegex) {
|
|
// If the baseUrl isn't part of this URL, penalize this
|
|
// link. It could still be the link, but the odds are lower.
|
|
// Example:
|
|
// http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in-ActionScript-3/Page1.html
|
|
if (!baseRegex.test(href)) {
|
|
return -25;
|
|
}
|
|
|
|
return 0;
|
|
}
|