npm-convert.js
function convertForPackage(context, pkg) {
	var name = pkg.name;
	var version = pkg.version;

	var conv = context.deferredConversions;
	var pkgConv = conv[name];
	var depPkg, fns, keys = 0;
	if(pkgConv) {
		for(var range in pkgConv) {
			depPkg = crawl.matchedVersion(context, name, range);
			if(depPkg) {
				fns = pkgConv[range];
				for(var i = 0, len = fns.length; i < len; i++) {
					fns[i].call(context);
				}
				delete pkgConv[range];
			} else {
				keys++;
			}
		}
		if(keys === 0) {
			delete conv[name];
		}
	}
}
function convertForPackage(context, pkg) {
	var name = pkg.name;
	var version = pkg.version;

	var conv = context.deferredConversions;
	var pkgConv = conv[name];
	var depPkg, fns, keys = 0;
	if(pkgConv) {
		for(var range in pkgConv) {
			depPkg = crawl.matchedVersion(context, name, range);
			if(depPkg) {
				fns = pkgConv[range];
				for(var i = 0, len = fns.length; i < len; i++) {
					fns[i].call(context);
				}
				delete pkgConv[range];
			} else {
				keys++;
			}
		}
		if(keys === 0) {
			delete conv[name];
		}
	}
}
function convertForPackage ( context , pkg ) { var name = pkg . name ; var version = pkg . version ; var conv = context . deferredConversions ; var pkgConv = conv [ name ] ; var depPkg , fns , keys = 0 ; if ( pkgConv ) { for ( var range in pkgConv ) { depPkg = crawl . matchedVersion ( context , name , range ) ; if ( depPkg ) { fns = pkgConv [ range ] ; for ( var i = 0 , len = fns . length ; i < len ; i ++ ) { fns [ i ] . call ( context ) ; } delete pkgConv [ range ] ; } else { keys ++ ; } } if ( keys === 0 ) { delete conv [ name ] ; } } }
When progressively loading package.jsons we need to convert any config
that is waiting on a package.json to load. This function is called after
a package is loaded and will call all of the callbacks that cause the
config to be applied.
When progressively loading package . jsons we need to convert any config that is waiting on a package . json to load . This function is called after a package is loaded and will call all of the callbacks that cause the config to be applied .