substack/node-detective — pull request #12 by dominictarr (2012-04-23 12:55:44+00:00)
Title: handle deep chaining; (fix issue #11)

Added failing test, then fixed it.

Instead of inspecting the children of the node, inspect it's parents...

The traversal stops on each string, so check if that string is the child of a call to require.

Can't say this is the best solution,
but this fixes the deep chaining bug #11,
with a short edit distance from the original code.