From 9d4e0cb20551e08deaff6225697e00a072c9c179 Mon Sep 17 00:00:00 2001 From: Pawel Tomaszewski Date: Wed, 13 Nov 2024 19:02:00 +0100 Subject: [PATCH] comment --- visual-js/visual/src/utils.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/visual-js/visual/src/utils.ts b/visual-js/visual/src/utils.ts index f5a5cab..f81f50d 100644 --- a/visual-js/visual/src/utils.ts +++ b/visual-js/visual/src/utils.ts @@ -133,17 +133,21 @@ export const parseRegionsForAPI = async ( async ( itemOrRegionOrSelector, ): Promise> => { - 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)