lib/cyclic.js
function resolver(id, modules, circular, resolved, unresolved) {
	unresolved[id] = true;

	if (modules[id]) {
		modules[id].forEach((dependency) => {
			if (!resolved[dependency]) {
				if (unresolved[dependency]) {
					circular.push(getPath(dependency, unresolved));
					return;
				}
				resolver(dependency, modules, circular, resolved, unresolved);
			}
		});
	}

	resolved[id] = true;
	unresolved[id] = false;
}
function resolver(id, modules, circular, resolved, unresolved) {
	unresolved[id] = true;

	if (modules[id]) {
		modules[id].forEach((dependency) => {
			if (!resolved[dependency]) {
				if (unresolved[dependency]) {
					circular.push(getPath(dependency, unresolved));
					return;
				}
				resolver(dependency, modules, circular, resolved, unresolved);
			}
		});
	}

	resolved[id] = true;
	unresolved[id] = false;
}
function resolver ( id , modules , circular , resolved , unresolved ) { unresolved [ id ] = true ; if ( modules [ id ] ) { modules [ id ] . forEach ( ( dependency ) => { if ( ! resolved [ dependency ] ) { if ( unresolved [ dependency ] ) { circular . push ( getPath ( dependency , unresolved ) ) ; return ; } resolver ( dependency , modules , circular , resolved , unresolved ) ; } } ) ; } resolved [ id ] = true ; unresolved [ id ] = false ; }
A circular dependency is occurring when we see a software package
more than once, unless that software package has all its dependencies resolved.
@param  {String} id
@param  {Object} modules
@param  {Object} circular
@param  {Object} resolved
@param  {Object} unresolved
A circular dependency is occurring when we see a software package more than once unless that software package has all its dependencies resolved .