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
240 B
JavaScript
12 lines
240 B
JavaScript
8 years ago
|
import { addScore } from './index'
|
||
|
|
||
|
// Adds 1/4 of a child's score to its parent
|
||
|
export default function addToParent(node, $, score) {
|
||
|
const parent = node.parent()
|
||
|
if (parent) {
|
||
|
addScore(parent, $, score * .25)
|
||
|
}
|
||
|
|
||
|
return node
|
||
|
}
|