index.js
function asTemplateValue(value, isAttribute) {
  var presuf = isAttribute ? '' : createHyperComment();
  switch(typeof value) {
    case 'string': return presuf + escape(value) + presuf;
    case 'boolean':
    case 'number': return presuf + value + presuf;
    case 'function': return asTemplateValue(value({}), isAttribute);
    case 'object':
      if (value instanceof Buffer) return presuf + value + presuf;
      if (value instanceof Component) return asTemplateValue(value.render(), isAttribute);
    case 'undefined':
      if (value == null) return presuf + '' + presuf;
    default:
      if (isArray(value)) {
        for (var i = 0, length = value.length; i < length; i++) {
          if (value[i] instanceof Component) {
            value[i] = value[i].render();
          }
        }
        return presuf + value.join('') + presuf;
      }
      if ('placeholder' in value) return invokeAtDistance(value, true);
      if ('text' in value) return presuf + escape(value.text) + presuf;
      if ('any' in value) return asTemplateValue(value.any, isAttribute);
      if ('html' in value) return presuf + [].concat(value.html).join('') + presuf;
      return asTemplateValue(invokeTransformer(value), isAttribute);
  }
}
function asTemplateValue(value, isAttribute) {
  var presuf = isAttribute ? '' : createHyperComment();
  switch(typeof value) {
    case 'string': return presuf + escape(value) + presuf;
    case 'boolean':
    case 'number': return presuf + value + presuf;
    case 'function': return asTemplateValue(value({}), isAttribute);
    case 'object':
      if (value instanceof Buffer) return presuf + value + presuf;
      if (value instanceof Component) return asTemplateValue(value.render(), isAttribute);
    case 'undefined':
      if (value == null) return presuf + '' + presuf;
    default:
      if (isArray(value)) {
        for (var i = 0, length = value.length; i < length; i++) {
          if (value[i] instanceof Component) {
            value[i] = value[i].render();
          }
        }
        return presuf + value.join('') + presuf;
      }
      if ('placeholder' in value) return invokeAtDistance(value, true);
      if ('text' in value) return presuf + escape(value.text) + presuf;
      if ('any' in value) return asTemplateValue(value.any, isAttribute);
      if ('html' in value) return presuf + [].concat(value.html).join('') + presuf;
      return asTemplateValue(invokeTransformer(value), isAttribute);
  }
}
function asTemplateValue ( value , isAttribute ) { var presuf = isAttribute ? '' : createHyperComment ( ) ; switch ( typeof value ) { case 'string' : return presuf + escape ( value ) + presuf ; case 'boolean' : case 'number' : return presuf + value + presuf ; case 'function' : return asTemplateValue ( value ( { } ) , isAttribute ) ; case 'object' : if ( value instanceof Buffer ) return presuf + value + presuf ; if ( value instanceof Component ) return asTemplateValue ( value . render ( ) , isAttribute ) ; case 'undefined' : if ( value == null ) return presuf + '' + presuf ; default : if ( isArray ( value ) ) { for ( var i = 0 , length = value . length ; i < length ; i ++ ) { if ( value [ i ] instanceof Component ) { value [ i ] = value [ i ] . render ( ) ; } } return presuf + value . join ( '' ) + presuf ; } if ( 'placeholder' in value ) return invokeAtDistance ( value , true ) ; if ( 'text' in value ) return presuf + escape ( value . text ) + presuf ; if ( 'any' in value ) return asTemplateValue ( value . any , isAttribute ) ; if ( 'html' in value ) return presuf + [ ] . concat ( value . html ) . join ( '' ) + presuf ; return asTemplateValue ( invokeTransformer ( value ) , isAttribute ) ; } }
multiple content joined as single string
multiple content joined as single string