feat: calculates a penalty score based on a CSS selector pat.

This commit is contained in:
karishmas6
2024-06-05 22:36:53 +05:30
parent 82a447cd5d
commit 40100eb495

View File

@@ -286,6 +286,10 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
return query;
}
function penalty(path: Path): number {
return path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0);
}
};