File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,25 +33,22 @@ api['toString'] = toString;
3333api [ 'html' ] = html ;
3434api [ 'Internals' ] = Internals ;
3535
36- /** @type {any } */
37- const global = globalThis ;
38-
3936// Bind the API into the global scope. Allows middleware and other code to
4037// reference the core API. Once import maps are more mainstream, we can
4138// deprecate this.
4239if ( $$diffHTML in globalThis ) {
43- const existingApi = global [ $$diffHTML ] ;
40+ const existingApi = globalThis [ $$diffHTML ] ;
4441
4542 if ( VERSION !== existingApi [ 'VERSION' ] ) {
4643 console . log ( `Loaded ${ VERSION } after ${ existingApi . VERSION } ` ) ;
4744 }
4845}
4946
50- global [ $$diffHTML ] = api ;
47+ globalThis [ $$diffHTML ] = api ;
5148
5249// Automatically hook up to DevTools if they are present.
53- if ( global . devTools ) {
54- global . unsubscribeDevTools = use ( global . devTools ( Internals ) ) ;
50+ if ( globalThis . devTools ) {
51+ globalThis . unsubscribeDevTools = use ( globalThis . devTools ( Internals ) ) ;
5552}
5653
5754export {
Original file line number Diff line number Diff line change @@ -28,24 +28,21 @@ api.innerHTML = innerHTML;
2828api . html = createTree ;
2929api . Internals = internals ;
3030
31- /** @type {any } */
32- const global = globalThis ;
33-
3431// Bind the API into the global scope. Allows middleware and other code to
3532// reference the core API.
3633if ( $$diffHTML in globalThis ) {
37- const existingApi = global [ $$diffHTML ] ;
34+ const existingApi = globalThis [ $$diffHTML ] ;
3835
3936 if ( VERSION !== existingApi . VERSION ) {
4037 console . log ( `Loaded ${ VERSION } after ${ existingApi . VERSION } ` ) ;
4138 }
4239}
4340
44- global [ $$diffHTML ] = api ;
41+ globalThis [ $$diffHTML ] = api ;
4542
4643// Automatically hook up to DevTools if they are present.
47- if ( global . devTools ) {
48- global . unsubscribeDevTools = use ( global . devTools ( internals ) ) ;
44+ if ( globalThis . devTools ) {
45+ globalThis . unsubscribeDevTools = use ( globalThis . devTools ( internals ) ) ;
4946}
5047
5148export {
Original file line number Diff line number Diff line change 11/**
22 * @type {{
3- * [key: string]: any;
3+ * [key: string | symbol ]: any;
44 * }}
55 */
66export default typeof global === 'object' ? global : ( typeof window === 'object' ? window : self ) || { } ;
You can’t perform that action at this time.
0 commit comments