File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11/* global window self */
22
33const isBrowser =
4- typeof window !== " undefined" && typeof window . document !== " undefined" ;
4+ typeof window !== ' undefined' && typeof window . document !== ' undefined' ;
55
66/* eslint-disable no-restricted-globals */
77const isWebWorker =
8- typeof self === " object" &&
8+ typeof self === ' object' &&
99 self . constructor &&
10- self . constructor . name === " DedicatedWorkerGlobalScope" ;
10+ self . constructor . name === ' DedicatedWorkerGlobalScope' ;
1111/* eslint-enable no-restricted-globals */
1212
1313const isNode =
14- typeof process !== " undefined" &&
14+ typeof process !== ' undefined' &&
1515 process . versions != null &&
1616 process . versions . node != null ;
1717
1818/**
1919 * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0
2020 * @see https://github.com/jsdom/jsdom/issues/1537
2121 */
22+ /* eslint-disable no-undef */
2223const isJsDom = ( ) =>
23- ( typeof window !== " undefined" && window . name === " nodejs" ) ||
24- navigator . userAgent . includes ( " Node.js" ) ||
25- navigator . userAgent . includes ( " jsdom" ) ;
24+ ( typeof window !== ' undefined' && window . name === ' nodejs' ) ||
25+ navigator . userAgent . includes ( ' Node.js' ) ||
26+ navigator . userAgent . includes ( ' jsdom' ) ;
2627
2728export { isBrowser , isWebWorker , isNode , isJsDom } ;
You can’t perform that action at this time.
0 commit comments