This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,16 +47,20 @@ export function patchPrototype(prototype: any, fnNames: string[]) {
4747export const isWebWorker : boolean =
4848 ( typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ) ;
4949
50+ // Make sure to access `process` through `_global` so that WebPack does not accidently browserify
51+ // this code.
5052export const isNode : boolean =
51- ( ! ( 'nw' in _global ) && typeof process !== 'undefined' &&
52- { } . toString . call ( process ) === '[object process]' ) ;
53+ ( ! ( 'nw' in _global ) && typeof _global . process !== 'undefined' &&
54+ { } . toString . call ( _global . process ) === '[object process]' ) ;
5355
5456export const isBrowser : boolean =
5557 ! isNode && ! isWebWorker && ! ! ( typeof window !== 'undefined' && ( window as any ) [ 'HTMLElement' ] ) ;
5658
5759// we are in electron of nw, so we are both browser and nodejs
58- export const isMix : boolean = typeof process !== 'undefined' &&
59- { } . toString . call ( process ) === '[object process]' && ! isWebWorker &&
60+ // Make sure to access `process` through `_global` so that WebPack does not accidently browserify
61+ // this code.
62+ export const isMix : boolean = typeof _global . process !== 'undefined' &&
63+ { } . toString . call ( _global . process ) === '[object process]' && ! isWebWorker &&
6064 ! ! ( typeof window !== 'undefined' && ( window as any ) [ 'HTMLElement' ] ) ;
6165
6266export function patchProperty ( obj : any , prop : string , prototype ?: any ) {
You can’t perform that action at this time.
0 commit comments