Allow suncalc to be exported via `globalThis`

pull/3259/head
Anton 2024-03-16 11:30:01 +01:00
parent a00f1b6568
commit 4a7738cebc
2 changed files with 2 additions and 1 deletions

View File

@ -92,6 +92,7 @@ module.exports = {
"getSerial": "readonly", "getSerial": "readonly",
"getTime": "readonly", "getTime": "readonly",
"global": "readonly", "global": "readonly",
"globalThis": "writable",
"HIGH": "readonly", "HIGH": "readonly",
"I2C1": "readonly", "I2C1": "readonly",
"Infinity": "readonly", "Infinity": "readonly",

View File

@ -336,6 +336,6 @@ SunCalc.getMoonTimes = function (date, lat, lng, inUTC) {
// export as Node module / AMD module / browser variable // export as Node module / AMD module / browser variable
if (typeof exports === 'object' && typeof module !== 'undefined') module.exports = SunCalc; if (typeof exports === 'object' && typeof module !== 'undefined') module.exports = SunCalc;
//else if (typeof define === 'function' && define.amd) define(SunCalc); //else if (typeof define === 'function' && define.amd) define(SunCalc);
//else window.SunCalc = SunCalc; else globalThis.SunCalc = SunCalc;
}()); }());