Skip to content

Commit

Permalink
improve portability of the UMD build:
Browse files Browse the repository at this point in the history
- replace `self` with `globalThis`
- make module detection more robust
  • Loading branch information
chocolateboy committed Jul 31, 2021
1 parent 4b307da commit a6c61ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
};

/* istanbul ignore else */
if (typeof module === 'object' && typeof module.exports === 'object') {
if (typeof module === 'object' && module && typeof module.exports === 'object') {
module.exports = mapping;
} else {
self.FantasyLand = mapping;
globalThis.FantasyLand = mapping;
}

} ());

0 comments on commit a6c61ba

Please sign in to comment.