This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,20 @@ export function patchPrototype(prototype: any, fnNames: string[]) {
47
47
export const isWebWorker : boolean =
48
48
( typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ) ;
49
49
50
+ // Make sure to access `process` through `_global` so that WebPack does not accidently browserify
51
+ // this code.
50
52
export 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]' ) ;
53
55
54
56
export const isBrowser : boolean =
55
57
! isNode && ! isWebWorker && ! ! ( typeof window !== 'undefined' && ( window as any ) [ 'HTMLElement' ] ) ;
56
58
57
59
// 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 &&
60
64
! ! ( typeof window !== 'undefined' && ( window as any ) [ 'HTMLElement' ] ) ;
61
65
62
66
export function patchProperty ( obj : any , prop : string , prototype ?: any ) {
You can’t perform that action at this time.
0 commit comments