UNPKG

ember-source

Version:

A JavaScript framework for creating ambitious web applications

5 lines (3 loc) 601 B
// check if window exists and actually is the global const hasDOM = typeof self === 'object' && self !== null && self.Object === Object && typeof Window !== 'undefined' && self.constructor === Window && typeof document === 'object' && document !== null && self.document === document && typeof location === 'object' && location !== null && self.location === location && typeof history === 'object' && history !== null && self.history === history && typeof navigator === 'object' && navigator !== null && self.navigator === navigator && typeof navigator.userAgent === 'string'; export { hasDOM as h };