lib/moduleLoader/lib/requireAll.js
function (modules, options, iterationInfo) {
        // load module into memory (unless `dontLoad` is true)

        var module = true;

        //default is options.dontLoad === false
        if (options.dontLoad !== true) {
            //if module is to be loaded
            module = require(iterationInfo.absoluteFullPath);

            // If a module is found but was loaded as 'undefined', don't include it (since it's probably unusable)
            if (typeof module === 'undefined') {
                throw new Error('Invalid module:' + iterationInfo.absoluteFullPath);
            }

            var identity;
            //var name;
            var version;

            if (options.useVersions === true) {
                if (module.version) {
                    version = module.version;
                }
                else {
                    version = '1.0';
                }
            }

            if (module.identity) {
                identity = module.identity;
                //name = identity;
            }
            else {
                identity = generateIdentity(options, iterationInfo);
                //name = identity;
            }

            //consider default options.injectIdentity === true
            if (options.injectIdentity !== false) {
                module.fileName = iterationInfo.fileName;
                module.projectDir = iterationInfo.projectDir;
                module.relativePath = iterationInfo.relativePath;
                module.relativeFullPath = iterationInfo.relativeFullPath;
                module.absolutePath = iterationInfo.absolutePath;
                module.absoluteFullPath = iterationInfo.absoluteFullPath;
                module.identity = identity;
                //module.name = name;
                if (options.useVersions === true) {
                    module.version = version;
                }
            }
            else {
                identity = generateIdentity(options, iterationInfo);
            }

            //check if identity is unique within the collection and add to dictionary
            if (options.useVersions === true) {
                if (modules[identity] && modules[identity][version]) {
                    var anotherModule = modules[identity][version];
                    throw new Error("Identity '" + identity + "' with version '" + version + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = modules[identity] || {};
                modules[identity][version] = module;
            }
            else {
                var anotherModule = modules[identity];
                if (anotherModule) {
                    throw new Error("Identity '" + identity + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = module;
            }
        }
    }
function (modules, options, iterationInfo) {
        // load module into memory (unless `dontLoad` is true)

        var module = true;

        //default is options.dontLoad === false
        if (options.dontLoad !== true) {
            //if module is to be loaded
            module = require(iterationInfo.absoluteFullPath);

            // If a module is found but was loaded as 'undefined', don't include it (since it's probably unusable)
            if (typeof module === 'undefined') {
                throw new Error('Invalid module:' + iterationInfo.absoluteFullPath);
            }

            var identity;
            //var name;
            var version;

            if (options.useVersions === true) {
                if (module.version) {
                    version = module.version;
                }
                else {
                    version = '1.0';
                }
            }

            if (module.identity) {
                identity = module.identity;
                //name = identity;
            }
            else {
                identity = generateIdentity(options, iterationInfo);
                //name = identity;
            }

            //consider default options.injectIdentity === true
            if (options.injectIdentity !== false) {
                module.fileName = iterationInfo.fileName;
                module.projectDir = iterationInfo.projectDir;
                module.relativePath = iterationInfo.relativePath;
                module.relativeFullPath = iterationInfo.relativeFullPath;
                module.absolutePath = iterationInfo.absolutePath;
                module.absoluteFullPath = iterationInfo.absoluteFullPath;
                module.identity = identity;
                //module.name = name;
                if (options.useVersions === true) {
                    module.version = version;
                }
            }
            else {
                identity = generateIdentity(options, iterationInfo);
            }

            //check if identity is unique within the collection and add to dictionary
            if (options.useVersions === true) {
                if (modules[identity] && modules[identity][version]) {
                    var anotherModule = modules[identity][version];
                    throw new Error("Identity '" + identity + "' with version '" + version + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = modules[identity] || {};
                modules[identity][version] = module;
            }
            else {
                var anotherModule = modules[identity];
                if (anotherModule) {
                    throw new Error("Identity '" + identity + "' is already registered by module at '" + anotherModule.absoluteFullPath + "'");
                }
                modules[identity] = module;
            }
        }
    }
function ( modules , options , iterationInfo ) { // load module into memory (unless `dontLoad` is true) var module = true ; //default is options.dontLoad === false if ( options . dontLoad !== true ) { //if module is to be loaded module = require ( iterationInfo . absoluteFullPath ) ; // If a module is found but was loaded as 'undefined', don't include it (since it's probably unusable) if ( typeof module === 'undefined' ) { throw new Error ( 'Invalid module:' + iterationInfo . absoluteFullPath ) ; } var identity ; //var name; var version ; if ( options . useVersions === true ) { if ( module . version ) { version = module . version ; } else { version = '1.0' ; } } if ( module . identity ) { identity = module . identity ; //name = identity; } else { identity = generateIdentity ( options , iterationInfo ) ; //name = identity; } //consider default options.injectIdentity === true if ( options . injectIdentity !== false ) { module . fileName = iterationInfo . fileName ; module . projectDir = iterationInfo . projectDir ; module . relativePath = iterationInfo . relativePath ; module . relativeFullPath = iterationInfo . relativeFullPath ; module . absolutePath = iterationInfo . absolutePath ; module . absoluteFullPath = iterationInfo . absoluteFullPath ; module . identity = identity ; //module.name = name; if ( options . useVersions === true ) { module . version = version ; } } else { identity = generateIdentity ( options , iterationInfo ) ; } //check if identity is unique within the collection and add to dictionary if ( options . useVersions === true ) { if ( modules [ identity ] && modules [ identity ] [ version ] ) { var anotherModule = modules [ identity ] [ version ] ; throw new Error ( "Identity '" + identity + "' with version '" + version + "' is already registered by module at '" + anotherModule . absoluteFullPath + "'" ) ; } modules [ identity ] = modules [ identity ] || { } ; modules [ identity ] [ version ] = module ; } else { var anotherModule = modules [ identity ] ; if ( anotherModule ) { throw new Error ( "Identity '" + identity + "' is already registered by module at '" + anotherModule . absoluteFullPath + "'" ) ; } modules [ identity ] = module ; } } }
Load single module
@param modules
@param options
@param iterationInfo
Load single module