One line fix accounting for mocking with Jest 

Mocking with Jest (and possibly some other weird cases) causes the module.parent to be undefined. If this isn't checked the module breaks on require. I am not entirely sure if this is the right place to fix this, the Jest module loader might be better, but this is the only module I have encountered that does this.
the check for module.parent should go in the else on line 63.