Skip to content

Commit

Permalink
Update node.js workaround from global → globalThis
Browse files Browse the repository at this point in the history
the node.js global object is deprecated in favor of the cross-platform standard globalThis object. references:
• https://nodejs.org/api/globals.html#globalhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
  • Loading branch information
acusti committed Jul 2, 2024
1 parent 59e5a34 commit 8963503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,8 @@ if (typeof module !== 'undefined' && module.exports) {
}

// hack for components to work correctly in node.js
if (typeof global !== 'undefined') {
global.Prism = Prism;
if (typeof globalThis !== 'undefined') {
globalThis.Prism = Prism;
}

// some additional documentation/types
Expand Down

0 comments on commit 8963503

Please sign in to comment.