Also, this check should be `typeof module === "object"` since we care about actually testing what `module` is, not just its existence.