File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -66,21 +66,21 @@ export const DEFAULT_TTL = 0; // 0 = no expiration
6666 * @internal
6767 */
6868const BASE_GLOBALS : Record < string , unknown > = {
69- require,
70- module,
71- exports,
69+ require : typeof require !== 'undefined' ? require : undefined ,
70+ module : typeof module !== 'undefined' ? module : undefined ,
71+ exports : typeof exports !== 'undefined' ? exports : undefined ,
7272 console,
73- Buffer,
74- process,
73+ Buffer : typeof Buffer !== 'undefined' ? Buffer : undefined ,
74+ process : typeof process !== 'undefined' ? process : undefined ,
7575 setTimeout,
7676 setInterval,
77- setImmediate,
77+ setImmediate : typeof setImmediate !== 'undefined' ? setImmediate : undefined ,
7878 clearTimeout,
7979 clearInterval,
80- clearImmediate,
80+ clearImmediate : typeof clearImmediate !== 'undefined' ? clearImmediate : undefined ,
8181 queueMicrotask,
82- __dirname,
83- __filename,
82+ __dirname : typeof __dirname !== 'undefined' ? __dirname : undefined ,
83+ __filename : typeof __filename !== 'undefined' ? __filename : undefined ,
8484 // Global constructors
8585 Array,
8686 Object,
You can’t perform that action at this time.
0 commit comments