"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function domToMana(domElement, goDeep) {
    if (goDeep === void 0) { goDeep = false; }
    if (!domElement) {
        return;
    }
    if (domElement.nodeType === 1) {
        var mana = {
            elementName: domElement.tagName.toLowerCase(),
            attributes: {
                id: domElement.getAttribute('id'),
                class: domElement.getAttribute('class'),
                'haiku-id': domElement.getAttribute('haiku-id'),
            },
            children: [],
        };
        if (goDeep) {
            mana.children = domElement.children.map(function (childNode) {
                return domToMana(childNode, true);
            });
        }
        return mana;
    }
    if (domElement.nodeType === 3) {
        return domElement.textContent;
    }
}
exports.default = domToMana;
//# sourceMappingURL=domToMana.js.map