src/selectivity.js
function(templateName, options) {
        var template = this.templates[templateName];
        if (!template) {
            throw new Error('Unknown template: ' + templateName);
        }

        if (typeof template === 'function') {
            var templateResult = template(options);
            return typeof templateResult === 'string' ? templateResult.trim() : templateResult;
        } else if (template.render) {
            return template.render(options).trim();
        } else {
            return template.toString().trim();
        }
    }
function(templateName, options) {
        var template = this.templates[templateName];
        if (!template) {
            throw new Error('Unknown template: ' + templateName);
        }

        if (typeof template === 'function') {
            var templateResult = template(options);
            return typeof templateResult === 'string' ? templateResult.trim() : templateResult;
        } else if (template.render) {
            return template.render(options).trim();
        } else {
            return template.toString().trim();
        }
    }
function ( templateName , options ) { var template = this . templates [ templateName ] ; if ( ! template ) { throw new Error ( 'Unknown template: ' + templateName ) ; } if ( typeof template === 'function' ) { var templateResult = template ( options ) ; return typeof templateResult === 'string' ? templateResult . trim ( ) : templateResult ; } else if ( template . render ) { return template . render ( options ) . trim ( ) ; } else { return template . toString ( ) . trim ( ) ; } }
Returns the result of the given template.

@param templateName Name of the template to process.
@param options Options to pass to the template.

@return String containing HTML or ReactElement if template is a function returning
ReactElement.
Returns the result of the given template .