import isInstance from './isInstance';
/**
 * Returns normalized list of targets, ie. it de-reference the element from the RefObject if needed.
 * @param targets a list of targets or refs to normalize.
 * @returns a new list of the same length with the de-referenced targets.
 */
const normalizeTargets = (targets) => {
    return targets.flatMap((t) => {
        if (!t)
            return [];
        const target = isInstance(t, EventTarget) ? t : t.current;
        if (!target)
            return [];
        return [target];
    });
};
export default normalizeTargets;
//# sourceMappingURL=normalizeTargets.js.map