UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

19 lines (17 loc) 598 B
var getPreviousSibling = function (elem, selector) { // Get the next sibling element var sibling = elem.previousElementSibling; // If there's no selector, return the first sibling if (!selector) return sibling; // If the sibling matches our selector, use it // If not, jump to the next sibling and continue the loop while (sibling) { if (sibling.matches(selector)) return sibling; sibling = sibling.previousElementSibling; } return; }; export { getPreviousSibling as default }; //# sourceMappingURL=getPreviousSibling.js.map