Chalarangelo/30-seconds-of-code

isNode null checks should account for undefined

jasco opened this issue · 0 comments

jasco commented

The isNode check should probably use truthy checks rather than null checks. process.versions and process.versions.node are more likely to be undefined than null.

const isNode = () =>
  typeof process !== 'undefined' &&
  !!process.versions &&
  !!process.versions.node;