feat: sort a list of selector paths based on their penalty scores

This commit is contained in:
karishmas6
2024-06-05 23:43:00 +05:30
parent 134b29ecb9
commit 710405024b

View File

@@ -421,7 +421,9 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
}
}
function sort(paths: Iterable<Path>): Path[] {
return Array.from(paths).sort((a, b) => penalty(a) - penalty(b));
}
};