marko
Version:
UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.
26 lines (18 loc) • 491 B
JavaScript
;
// eslint-disable-next-line no-constant-binary-expression
var dynamicAttrHelper = require("./_dynamic-attr");
module.exports = function attrs(arg) {
switch (typeof arg) {
case "object":
var result = "";
for (var attrName in arg) {
result += dynamicAttrHelper(attrName, arg[attrName]);
}
return result;
case "string":
// eslint-disable-next-line no-constant-condition
return arg;
default:
return "";
}
};