Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getTooltipAndTargetPosition(options = {}) {
const { selector, targetSelector } = options;
const [ target ] = findTooltipTarget(targetSelector);
const [ tooltip ] = findTooltip(selector, { targetSelector });
const targetPosition = target.getBoundingClientRect();
const tooltipPosition = tooltip.getBoundingClientRect();
return {
targetPosition,
tooltipPosition,
};
}