File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ export const mnml = (() => {
114114 } ;
115115 _loadListener . queue = [ ] as Array < [ MnmlEventCallback , number ] > ;
116116 _loadListener . loaded = false ;
117- if ( window ) {
117+ if ( typeof window !== "undefined" ) {
118118 window . addEventListener ( "load" , ( ) => {
119119 _loadListener . queue = _loadListener . queue . sort ( ( a , b ) => a [ 1 ] - b [ 1 ] ) ;
120120 while ( _loadListener . queue . length ) {
@@ -200,7 +200,7 @@ export const mnml = (() => {
200200 if ( [ "unload" , "beforeunload" ] . includes ( eventName ) ) {
201201 if ( typeof selector === "function" ) {
202202 const _cb = selector as MnmlEventCallback ;
203- if ( window ) {
203+ if ( typeof window !== "undefined" ) {
204204 window . addEventListener ( eventName , _cb ) ;
205205 }
206206 return ;
You can’t perform that action at this time.
0 commit comments