Given a js file with
function clone(x) { return x; }
if (typeof module === 'object' && module.exports) {
module.exports = clone;
}
we should not issue error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? on the module.exports check - it's an environment check and may very well be undefined in non-node environments and is totally valid.