File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/core/src/extensions/UniqueID Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,15 @@ const UniqueID = Extension.create({
52
52
types : [ ] ,
53
53
generateID : ( ) => {
54
54
// Use mock ID if tests are running.
55
- if ( ( window as any ) . __TEST_OPTIONS ) {
56
- if ( ( window as any ) . __TEST_OPTIONS . mockID === undefined ) {
57
- ( window as any ) . __TEST_OPTIONS . mockID = 0 ;
55
+ if ( typeof window !== "undefined" && ( window as any ) . __TEST_OPTIONS ) {
56
+ const testOptions = ( window as any ) . __TEST_OPTIONS ;
57
+ if ( testOptions . mockID === undefined ) {
58
+ testOptions . mockID = 0 ;
58
59
} else {
59
- ( window as any ) . __TEST_OPTIONS . mockID ++ ;
60
+ testOptions . mockID ++ ;
60
61
}
61
62
62
- return ( window as any ) . __TEST_OPTIONS . mockID . toString ( ) as string ;
63
+ return testOptions . mockID . toString ( ) as string ;
63
64
}
64
65
65
66
return v4 ( ) ;
You can’t perform that action at this time.
0 commit comments