lib/getDependencyLevels.js
function _buildLevel(nodes) {
		var level = []
		levels.push(level)
		var parents = []
		each(nodes, function(node) {
			if (!seenPaths[node.path]) {
				seenPaths[node.path] = true
				level.push(node.path)
			}
			if (node.isRoot) { return }

			node.parent.waitingForNumChildren -= 1

			if (node.parent.waitingForNumChildren == 0) {
				parents.push(node.parent)
			}
		})
		if (!parents.length) { return }
		_buildLevel(parents)
	}
function _buildLevel(nodes) {
		var level = []
		levels.push(level)
		var parents = []
		each(nodes, function(node) {
			if (!seenPaths[node.path]) {
				seenPaths[node.path] = true
				level.push(node.path)
			}
			if (node.isRoot) { return }

			node.parent.waitingForNumChildren -= 1

			if (node.parent.waitingForNumChildren == 0) {
				parents.push(node.parent)
			}
		})
		if (!parents.length) { return }
		_buildLevel(parents)
	}
function _buildLevel ( nodes ) { var level = [ ] levels . push ( level ) var parents = [ ] each ( nodes , function ( node ) { if ( ! seenPaths [ node . path ] ) { seenPaths [ node . path ] = true level . push ( node . path ) } if ( node . isRoot ) { return } node . parent . waitingForNumChildren -= 1 if ( node . parent . waitingForNumChildren == 0 ) { parents . push ( node . parent ) } } ) if ( ! parents . length ) { return } _buildLevel ( parents ) }
builds a list of dependency levels, where nodes in each level is dependent only on nodes in levels below it the dependency levels allow for parallel loading of every file in any given level
builds a list of dependency levels where nodes in each level is dependent only on nodes in levels below it the dependency levels allow for parallel loading of every file in any given level