lib/transformers/transformer.factory.js
function getTransformer(name, clientPlugin, pluginOptions) {

    // if in cache, just return it
    if (cache[name]) { return cache[name]; }

    var transformers = clientPlugin.transformers;
    var templateDir = clientPlugin.templateDir;

    // if no transformer, throw error
    if (!transformers[name]) { throw new Error('No transformer called ' + name); }

    // generate all the transformers
    _.each(transformers, function (transformer, transformerName) {
        cache[transformerName] = generateTransformer(transformerName, transformer, templateDir, pluginOptions);
    });

    // return the specific one that was requested
    return cache[name];
}
function getTransformer(name, clientPlugin, pluginOptions) {

    // if in cache, just return it
    if (cache[name]) { return cache[name]; }

    var transformers = clientPlugin.transformers;
    var templateDir = clientPlugin.templateDir;

    // if no transformer, throw error
    if (!transformers[name]) { throw new Error('No transformer called ' + name); }

    // generate all the transformers
    _.each(transformers, function (transformer, transformerName) {
        cache[transformerName] = generateTransformer(transformerName, transformer, templateDir, pluginOptions);
    });

    // return the specific one that was requested
    return cache[name];
}
function getTransformer ( name , clientPlugin , pluginOptions ) { // if in cache, just return it if ( cache [ name ] ) { return cache [ name ] ; } var transformers = clientPlugin . transformers ; var templateDir = clientPlugin . templateDir ; // if no transformer, throw error if ( ! transformers [ name ] ) { throw new Error ( 'No transformer called ' + name ) ; } // generate all the transformers _ . each ( transformers , function ( transformer , transformerName ) { cache [ transformerName ] = generateTransformer ( transformerName , transformer , templateDir , pluginOptions ) ; } ) ; // return the specific one that was requested return cache [ name ] ; }
Get a particular transformer from cache or generate it
@param name
@param clientPlugin
@param pluginOptions
Get a particular transformer from cache or generate it