index.js
function compose(auto_template, dictionary, key, params) {
    var composer = dictionary[key];

    // If auto_template is set to true, make dictionary value
    if (auto_template) {
        if (typeof composer === "string") {
            composer = _.template(composer);
        } else if (typeof composer !== "function" ) {
            var msg = 'Expected value to auto-template - "' + composer + '" - to be type "string"';
            msg += ' but got "' + typeof composer + '".';
            throw new Error(msg);
        }
    }

    switch (typeof composer) {
        case "string": return composer;
        case "function": return composer(params);
        default:
            {
                var msg = 'Unprocessable message "' + composer + '" of type "' + typeof composer;
                msg += '" for key "' + key + '".'
                throw new Error(msg);
            }
    }
}
function compose(auto_template, dictionary, key, params) {
    var composer = dictionary[key];

    // If auto_template is set to true, make dictionary value
    if (auto_template) {
        if (typeof composer === "string") {
            composer = _.template(composer);
        } else if (typeof composer !== "function" ) {
            var msg = 'Expected value to auto-template - "' + composer + '" - to be type "string"';
            msg += ' but got "' + typeof composer + '".';
            throw new Error(msg);
        }
    }

    switch (typeof composer) {
        case "string": return composer;
        case "function": return composer(params);
        default:
            {
                var msg = 'Unprocessable message "' + composer + '" of type "' + typeof composer;
                msg += '" for key "' + key + '".'
                throw new Error(msg);
            }
    }
}
function compose ( auto_template , dictionary , key , params ) { var composer = dictionary [ key ] ; // If auto_template is set to true, make dictionary value if ( auto_template ) { if ( typeof composer === "string" ) { composer = _ . template ( composer ) ; } else if ( typeof composer !== "function" ) { var msg = 'Expected value to auto-template - "' + composer + '" - to be type "string"' ; msg += ' but got "' + typeof composer + '".' ; throw new Error ( msg ) ; } } switch ( typeof composer ) { case "string" : return composer ; case "function" : return composer ( params ) ; default : { var msg = 'Unprocessable message "' + composer + '" of type "' + typeof composer ; msg += '" for key "' + key + '".' throw new Error ( msg ) ; } } }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Local Functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Local Functions