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 authored Jul 2, 2024
1 parent 59e5a34 commit 1911b0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,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 1911b0b

Please sign in to comment.