'use strict';
var $ = require('./$');
$.createElement = /** @function
* @param element
* @param attributes
* @param {...*} children */function (element, attributes) {
Eif (typeof element === 'string') {
element = $.create(element);
Iif (attributes != null) {
element.setAttributes(attributes);
}
} else {
element = element(attributes);
}
for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
children[_key - 2] = arguments[_key];
}
Iif (children && children.length) {
children.forEach(function (child) {
if (typeof child === 'string') {
element.appendText(child);
} else {
element.append(child);
}
});
}
return element;
};
//# sourceMappingURL=$.create.js.map |