added typeof module.exports check

this is related to the issue I logged re: module check (sorry should have just made it a pull request)