feat: use fallback if too many combinations found

This commit is contained in:
karishmas6
2024-06-05 22:19:52 +05:30
parent 76ff3392d3
commit 6dda179409

View File

@@ -255,6 +255,14 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
fallback?: () => Path | null
): Path | null {
const paths = sort(combinations(stack));
if (paths.length > config.threshold) {
return fallback ? fallback() : null;
}
return null;
}
};