feat: generator fxn to optimize given CSS selector path

This commit is contained in:
karishmas6
2024-06-06 00:28:15 +05:30
parent fff6149fef
commit ad61b2a0b1

View File

@@ -430,6 +430,16 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
visited: Map<string, boolean>;
};
function* optimize(
path: Path,
input: Element,
scope: Scope = {
counter: 0,
visited: new Map<string, boolean>(),
}
): Generator<Node[]> {
}
function same(path: Path, input: Element) {
return rootDocument.querySelector(selector(path)) === input;