isFalse('') returns true do nothing, testing with Node.js 0.10.40.
function isFalse(s) {
return typeof s !== 'number' && !s;
}
writeAttribute : function (name, content) {
if (typeof content == 'function') {
content = content();
}
if (isFalse(content)) {
return this;
}
return this.startAttribute(name).text(content).endAttribute();
}