Skip to content

Commit 4a7738c

Browse files
committed
Allow suncalc to be exported via globalThis
1 parent a00f1b6 commit 4a7738c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ module.exports = {
9292
"getSerial": "readonly",
9393
"getTime": "readonly",
9494
"global": "readonly",
95+
"globalThis": "writable",
9596
"HIGH": "readonly",
9697
"I2C1": "readonly",
9798
"Infinity": "readonly",

modules/suncalc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,6 @@ SunCalc.getMoonTimes = function (date, lat, lng, inUTC) {
336336
// export as Node module / AMD module / browser variable
337337
if (typeof exports === 'object' && typeof module !== 'undefined') module.exports = SunCalc;
338338
//else if (typeof define === 'function' && define.amd) define(SunCalc);
339-
//else window.SunCalc = SunCalc;
339+
else globalThis.SunCalc = SunCalc;
340340

341341
}());

0 commit comments

Comments
 (0)