lib/replace.js
function runModules(str, modules) {
    var replacements = [],
        module;

    if (Array.isArray(modules) === false) {
        modules = [modules];
    }

    modules.forEach(function forEachModule(module) {
        if (!module) {
            throw new Error("Unknown module '" + module + "'");
        }

        runModule(module, str, replacements);
    });

    return replacements;
}
function runModules(str, modules) {
    var replacements = [],
        module;

    if (Array.isArray(modules) === false) {
        modules = [modules];
    }

    modules.forEach(function forEachModule(module) {
        if (!module) {
            throw new Error("Unknown module '" + module + "'");
        }

        runModule(module, str, replacements);
    });

    return replacements;
}
function runModules ( str , modules ) { var replacements = [ ] , module ; if ( Array . isArray ( modules ) === false ) { modules = [ modules ] ; } modules . forEach ( function forEachModule ( module ) { if ( ! module ) { throw new Error ( "Unknown module '" + module + "'" ) ; } runModule ( module , str , replacements ) ; } ) ; return replacements ; }
Runs the given modules on the text and returns the insertions.

@private
@param {String} str
@param {Array<String|ReplacementModule>} modules
@returns {Array<Array>}
Runs the given modules on the text and returns the insertions .