src/core/base/wnModule.js
function (packageList)
		{
			if (!_.isObject(packageList))
				return false;

			var pkgList = _.keys(packageList);
			var pkgRequire;
			var pkgName;
			var pkgInfo;
			var depName;
			var depVersion;
			var i=0;
			var valid;
			var error;
			while (pkgList.length > 0)
			{
				valid=true;
				error=[];
				pkgName=pkgList[i];
				pkgInfo=packageList[pkgName];
				pkgRequire=pkgInfo.require;

				for (p in pkgRequire)
				{
					depName = p;
					depVersion = pkgRequire[p];
					if (packageList[depName]==undefined)
					{ error.push(depName+'@'+depVersion+' is not installed.'); continue; }
					if (depVersion!=="*" && packageList[depName].version!=depVersion)
					{ error.push(depName+' needs to be '+depVersion); }
				}

				if (valid||error.length>0)
				{
					if (error.length>0)
					{
						delete packageList[pkgName];
						for (e in error)
							self.e.log('Error on loading `'+pkgName+'`: '+error[e],'error');
					}
				
					pkgList.splice(i,1);
				}

				i++;
				if (i>=pkgList.length)
					i=0;
			}
		}
function (packageList)
		{
			if (!_.isObject(packageList))
				return false;

			var pkgList = _.keys(packageList);
			var pkgRequire;
			var pkgName;
			var pkgInfo;
			var depName;
			var depVersion;
			var i=0;
			var valid;
			var error;
			while (pkgList.length > 0)
			{
				valid=true;
				error=[];
				pkgName=pkgList[i];
				pkgInfo=packageList[pkgName];
				pkgRequire=pkgInfo.require;

				for (p in pkgRequire)
				{
					depName = p;
					depVersion = pkgRequire[p];
					if (packageList[depName]==undefined)
					{ error.push(depName+'@'+depVersion+' is not installed.'); continue; }
					if (depVersion!=="*" && packageList[depName].version!=depVersion)
					{ error.push(depName+' needs to be '+depVersion); }
				}

				if (valid||error.length>0)
				{
					if (error.length>0)
					{
						delete packageList[pkgName];
						for (e in error)
							self.e.log('Error on loading `'+pkgName+'`: '+error[e],'error');
					}
				
					pkgList.splice(i,1);
				}

				i++;
				if (i>=pkgList.length)
					i=0;
			}
		}
function ( packageList ) { if ( ! _ . isObject ( packageList ) ) return false ; var pkgList = _ . keys ( packageList ) ; var pkgRequire ; var pkgName ; var pkgInfo ; var depName ; var depVersion ; var i = 0 ; var valid ; var error ; while ( pkgList . length > 0 ) { valid = true ; error = [ ] ; pkgName = pkgList [ i ] ; pkgInfo = packageList [ pkgName ] ; pkgRequire = pkgInfo . require ; for ( p in pkgRequire ) { depName = p ; depVersion = pkgRequire [ p ] ; if ( packageList [ depName ] == undefined ) { error . push ( depName + '@' + depVersion + ' is not installed.' ) ; continue ; } if ( depVersion !== "*" && packageList [ depName ] . version != depVersion ) { error . push ( depName + ' needs to be ' + depVersion ) ; } } if ( valid || error . length > 0 ) { if ( error . length > 0 ) { delete packageList [ pkgName ] ; for ( e in error ) self . e . log ( 'Error on loading `' + pkgName + '`: ' + error [ e ] , 'error' ) ; } pkgList . splice ( i , 1 ) ; } i ++ ; if ( i >= pkgList . length ) i = 0 ; } }
Remove invalid packages from the packageList.
@param object $packageList
Remove invalid packages from the packageList .