Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
paweltomaszewskisaucelabs committed Nov 13, 2024
1 parent ce6ab80 commit 9d4e0cb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions visual-js/visual/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,21 @@ export const parseRegionsForAPI = async <T>(
async (
itemOrRegionOrSelector,
): Promise<Array<RegionIn | ElementIn | IgnoreSelectorIn>> => {
const { item, diffingOptions } = isRegionType(itemOrRegionOrSelector)
? {
const { item, diffingOptions } = (() => {
if (isRegionType(itemOrRegionOrSelector)) {
return {
item: itemOrRegionOrSelector.element,
diffingOptions: getDiffingOptions(itemOrRegionOrSelector),
}
: isIgnoreSelectorType(itemOrRegionOrSelector)
? {
};
} else if (isIgnoreSelectorType(itemOrRegionOrSelector)) {
return {
item: itemOrRegionOrSelector,
diffingOptions: itemOrRegionOrSelector.diffingOptions,
}
: { item: itemOrRegionOrSelector, diffingOptions: undefined };
};
}

return { item: itemOrRegionOrSelector, diffingOptions: undefined };
})();

const elements =
isIgnoreRegion(item) || isIgnoreSelectorType(item)
Expand Down

0 comments on commit 9d4e0cb

Please sign in to comment.