diff --git a/.eslintrc.json b/.eslintrc.json index 27cde45..13bc598 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,6 +10,10 @@ "no-undef": ["off"], "no-unused-vars": ["off"] } + }, + { + "files": "index.js", + "globals": {"globalThis": false} } ] } diff --git a/index.js b/index.js index f414193..8212585 100644 --- a/index.js +++ b/index.js @@ -28,10 +28,14 @@ }; /* istanbul ignore else */ - if (typeof module === 'object' && typeof module.exports === 'object') { + if ( + typeof module === 'object' && + module != null && + typeof module.exports === 'object' + ) { module.exports = mapping; } else { - self.FantasyLand = mapping; + globalThis.FantasyLand = mapping; } } ()); diff --git a/scripts/generate-js b/scripts/generate-js index 0bbfa71..0aa816a 100755 --- a/scripts/generate-js +++ b/scripts/generate-js @@ -11,10 +11,14 @@ cat >index.js <