"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const children_1 = __importDefault(require("./children")); const isDOMChildNode_1 = __importDefault(require("./isDOMChildNode")); /** * Find the index of a DOM element amongst its siblings * * @param elm - DOM element to find the index of * @return The index of `elm` * * @example * * ```ts * elmIndex(someDiv); * ``` */ function elmIndex(elm) { return isDOMChildNode_1.default(elm) ? children_1.default(elm.parentNode).indexOf(elm) : -1; } exports.default = elmIndex;