Skip to content

Commit cc289e1

Browse files
committed
update build script and address linting errors
1 parent a6c61ba commit cc289e1

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"no-undef": ["off"],
1111
"no-unused-vars": ["off"]
1212
}
13+
},
14+
{
15+
"files": "index.js",
16+
"globals": {"globalThis": false}
1317
}
1418
]
1519
}

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
};
2929

3030
/* istanbul ignore else */
31-
if (typeof module === 'object' && module && typeof module.exports === 'object') {
31+
if (
32+
typeof module === 'object' &&
33+
module != null &&
34+
typeof module.exports === 'object'
35+
) {
3236
module.exports = mapping;
3337
} else {
3438
globalThis.FantasyLand = mapping;

scripts/generate-js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ cat >index.js <<EOF
1111
};
1212
1313
/* istanbul ignore else */
14-
if (typeof module === 'object' && typeof module.exports === 'object') {
14+
if (
15+
typeof module === 'object' &&
16+
module != null &&
17+
typeof module.exports === 'object'
18+
) {
1519
module.exports = mapping;
1620
} else {
17-
self.FantasyLand = mapping;
21+
globalThis.FantasyLand = mapping;
1822
}
1923
2024
} ());

0 commit comments

Comments
 (0)