(target)
| 283 | } |
| 284 | |
| 285 | export function findDOMElements(target) { |
| 286 | if (isReactRefObj(target)) { |
| 287 | return target.current; |
| 288 | } |
| 289 | if (isFunction(target)) { |
| 290 | return target(); |
| 291 | } |
| 292 | if (typeof target === 'string' && canUseDOM) { |
| 293 | let selection = document.querySelectorAll(target); |
| 294 | if (!selection.length) { |
| 295 | selection = document.querySelectorAll(`#${target}`); |
| 296 | } |
| 297 | if (!selection.length) { |
| 298 | throw new Error( |
| 299 | `The target '${target}' could not be identified in the dom, tip: check spelling`, |
| 300 | ); |
| 301 | } |
| 302 | return selection; |
| 303 | } |
| 304 | return target; |
| 305 | } |
| 306 | |
| 307 | export function isArrayOrNodeList(els) { |
| 308 | if (els === null) { |
no test coverage detected
searching dependent graphs…