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.
11 lines
258 B
JavaScript
11 lines
258 B
JavaScript
8 years ago
|
import { EXTRANEOUS_LINK_HINTS_RE } from '../constants';
|
||
|
|
||
|
export default function scoreExtraneousLinks(href) {
|
||
|
// If the URL itself contains extraneous values, give a penalty.
|
||
|
if (EXTRANEOUS_LINK_HINTS_RE.test(href)) {
|
||
|
return -25;
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|