npm-crawl.js
function(loader, packageJSON, isRoot){
		var config = utils.pkg.config(packageJSON);
		var hasConfig = !!config;

		// convert npmIgnore
		var npmIgnore = hasConfig && config.npmIgnore;
		function convertToMap(arr) {
			var npmMap = {};
			for(var i = 0; i < arr.length; i++) {
				npmMap[arr[i]] = true;
			}
			return npmMap;
		}
		if(npmIgnore && typeof npmIgnore.length === 'number') {
			npmIgnore = config.npmIgnore = convertToMap(npmIgnore);
		}
		// convert npmDependencies
		var npmDependencies = hasConfig && config.npmDependencies;
		if(npmDependencies && typeof npmDependencies.length === "number") {
			config.npmDependencies = convertToMap(npmDependencies);
		}
		npmIgnore = npmIgnore || {};

		var deps = {};

		addDeps(packageJSON, packageJSON.peerDependencies || {}, deps,
				"peerDependencies", {_isPeerDependency: true});

		addDeps(packageJSON, packageJSON.dependencies || {}, deps, "dependencies");

		if(isRoot) {
			addDeps(packageJSON, packageJSON.devDependencies || {}, deps,
				   "devDependencies");
		}

		return deps;
	}
function(loader, packageJSON, isRoot){
		var config = utils.pkg.config(packageJSON);
		var hasConfig = !!config;

		// convert npmIgnore
		var npmIgnore = hasConfig && config.npmIgnore;
		function convertToMap(arr) {
			var npmMap = {};
			for(var i = 0; i < arr.length; i++) {
				npmMap[arr[i]] = true;
			}
			return npmMap;
		}
		if(npmIgnore && typeof npmIgnore.length === 'number') {
			npmIgnore = config.npmIgnore = convertToMap(npmIgnore);
		}
		// convert npmDependencies
		var npmDependencies = hasConfig && config.npmDependencies;
		if(npmDependencies && typeof npmDependencies.length === "number") {
			config.npmDependencies = convertToMap(npmDependencies);
		}
		npmIgnore = npmIgnore || {};

		var deps = {};

		addDeps(packageJSON, packageJSON.peerDependencies || {}, deps,
				"peerDependencies", {_isPeerDependency: true});

		addDeps(packageJSON, packageJSON.dependencies || {}, deps, "dependencies");

		if(isRoot) {
			addDeps(packageJSON, packageJSON.devDependencies || {}, deps,
				   "devDependencies");
		}

		return deps;
	}
function ( loader , packageJSON , isRoot ) { var config = utils . pkg . config ( packageJSON ) ; var hasConfig = ! ! config ; // convert npmIgnore var npmIgnore = hasConfig && config . npmIgnore ; function convertToMap ( arr ) { var npmMap = { } ; for ( var i = 0 ; i < arr . length ; i ++ ) { npmMap [ arr [ i ] ] = true ; } return npmMap ; } if ( npmIgnore && typeof npmIgnore . length === 'number' ) { npmIgnore = config . npmIgnore = convertToMap ( npmIgnore ) ; } // convert npmDependencies var npmDependencies = hasConfig && config . npmDependencies ; if ( npmDependencies && typeof npmDependencies . length === "number" ) { config . npmDependencies = convertToMap ( npmDependencies ) ; } npmIgnore = npmIgnore || { } ; var deps = { } ; addDeps ( packageJSON , packageJSON . peerDependencies || { } , deps , "peerDependencies" , { _isPeerDependency : true } ) ; addDeps ( packageJSON , packageJSON . dependencies || { } , deps , "dependencies" ) ; if ( isRoot ) { addDeps ( packageJSON , packageJSON . devDependencies || { } , deps , "devDependencies" ) ; } return deps ; }
Returns a map of the dependencies and their ranges.
@param {Object} loader
@param {Object} packageJSON
@param {Boolean} isRoot
@return {Object<String,Range>} A map of dependency names and requested version ranges.
Returns a map of the dependencies and their ranges .