"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const isDOMChildNode_1 = __importDefault(require("./isDOMChildNode")); const children_1 = __importDefault(require("./children")); /** * Get all sibling elements of a given DOM element * * @param elm - DOM element to find siblings of * @return Collection of sibling elements * * @example * * ```ts * siblings(someElement); * ``` */ function siblings(elm) { if (!isDOMChildNode_1.default(elm)) { return []; } return children_1.default(elm.parentNode) .filter((child) => child !== elm); } exports.default = siblings;