UNPKG

reactors

Version:

View components and APIs that work web, mobile and desktop!

22 lines (20 loc) 416 B
// @flow /* globals process window */ export default function guessPlatform(): $ReactorsPlatform { if ( typeof window !== 'undefined' && typeof window.document !== 'undefined' && window.document.body ) { if (window.process) { return 'desktop'; } return 'web'; } if (typeof process === 'object') { if (process.env.USER) { return 'node'; } } return 'mobile'; }