From cc289e1a17346880745c5489ff712f774eb1e603 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Mon, 2 Aug 2021 15:38:18 +0200 Subject: [PATCH] update build script and address linting errors --- .eslintrc.json | 4 ++++ index.js | 6 +++++- scripts/generate-js | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) 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 709b197..8212585 100644 --- a/index.js +++ b/index.js @@ -28,7 +28,11 @@ }; /* istanbul ignore else */ - if (typeof module === 'object' && module && typeof module.exports === 'object') { + if ( + typeof module === 'object' && + module != null && + typeof module.exports === 'object' + ) { module.exports = mapping; } else { 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 <