"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyAttr = applyAttr;
exports.removeAllAttr = removeAllAttr;
exports.mergeAttr = mergeAttr;
const id_1 = require("./id");
function applyAttr(element, attr) {
    removeAllAttr(element);
    mergeAttr(element, attr);
}
function removeAllAttr(element) {
    const attributes = element.attributes;
    for (const attr of attributes) {
        attributes.removeNamedItem(attr.name);
    }
}
function mergeAttr(element, attr) {
    for (const name in attr) {
        const value = attr[name];
        element.setAttribute((0, id_1.camelToDashed)(name), value);
    }
}
//# sourceMappingURL=attr.js.map