function getHeadingObject(heading) {
        // each node is processed twice by this method because nestHeadingsArray() and addNode() calls it
        // first time heading is real DOM node element, second time it is obj
        // that is causing problem so I am processing only original DOM node
        if (!(heading instanceof window.HTMLElement)) return heading

        if (options.ignoreHiddenElements && (!heading.offsetHeight || !heading.offsetParent)) {
            return null
        }

        const headingLabel = heading.getAttribute('data-heading-label') ||
            (options.headingLabelCallback ? String(options.headingLabelCallback(heading.textContent)) : heading.textContent.trim())
        var obj = {
            id: heading.id,
            children: [],
            nodeName: heading.nodeName,
            headingLevel: getHeadingLevel(heading),
            textContent: headingLabel
        }

        if (options.includeHtml) {
            obj.childNodes = heading.childNodes
        }

        if (options.headingObjectCallback) {
            return options.headingObjectCallback(obj, heading)
        }

        return obj
    }
Get important properties from a heading element and store in a plain object.
@param {HTMLElement} heading
@return {Object}