@hebcal/noaa 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.js +7 -3
- package/dist/esm/index.js +22 -4
- package/dist/index.d.ts +1 -2
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ GeoLocation constructor with parameters for all required fields.
|
|
|
66
66
|
| --- | --- | --- |
|
|
67
67
|
| name | <code>string</code> | The location name for display use such as "Lakewood, NJ" |
|
|
68
68
|
| latitude | <code>number</code> | the latitude in a double format such as 40.095965 for Lakewood, NJ. <b>Note: </b> For latitudes south of the equator, a negative value should be used. |
|
|
69
|
-
| longitude | <code>number</code> | double the longitude in a double format such as -74.222130 for Lakewood, NJ. <b>Note: </b> For longitudes
|
|
69
|
+
| longitude | <code>number</code> | double the longitude in a double format such as -74.222130 for Lakewood, NJ. <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime Meridian </a> (Greenwich), a negative value should be used. |
|
|
70
70
|
| elevation | <code>number</code> | the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating sunrise and set. |
|
|
71
71
|
| timeZoneId | <code>string</code> | the <code>TimeZone</code> for the location. |
|
|
72
72
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NOAACalculator = exports.GeoLocation = void 0;
|
|
4
|
-
|
|
4
|
+
(async () => {
|
|
5
|
+
if (typeof Temporal !== 'function') {
|
|
6
|
+
await Promise.resolve().then(() => require('temporal-polyfill/global'));
|
|
7
|
+
}
|
|
8
|
+
})();
|
|
5
9
|
/**
|
|
6
10
|
* java.lang.Math.toRadians
|
|
7
11
|
* @private
|
|
@@ -39,7 +43,7 @@ class GeoLocation {
|
|
|
39
43
|
* <b>Note: </b> For latitudes south of the equator, a negative value should be used.
|
|
40
44
|
* @param {number} longitude
|
|
41
45
|
* double the longitude in a double format such as -74.222130 for Lakewood, NJ.
|
|
42
|
-
* <b>Note: </b> For longitudes
|
|
46
|
+
* <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime
|
|
43
47
|
* Meridian </a> (Greenwich), a negative value should be used.
|
|
44
48
|
* @param {number} elevation
|
|
45
49
|
* the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating
|
|
@@ -662,7 +666,7 @@ class NOAACalculator {
|
|
|
662
666
|
return cal
|
|
663
667
|
.toZonedDateTime({
|
|
664
668
|
timeZone: 'UTC',
|
|
665
|
-
plainTime: new
|
|
669
|
+
plainTime: new Temporal.PlainTime(hours, minutes, seconds, Math.trunc(calculatedTime * 1000)),
|
|
666
670
|
})
|
|
667
671
|
.withTimeZone(this.geoLocation.getTimeZone());
|
|
668
672
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NOAACalculator = exports.GeoLocation = void 0;
|
|
13
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
if (typeof Temporal !== 'function') {
|
|
15
|
+
yield import('temporal-polyfill/global');
|
|
16
|
+
}
|
|
17
|
+
}))();
|
|
2
18
|
/**
|
|
3
19
|
* java.lang.Math.toRadians
|
|
4
20
|
* @private
|
|
@@ -25,7 +41,7 @@ const Long_MIN_VALUE = NaN;
|
|
|
25
41
|
* @author © Eliyahu Hershfeld 2004 - 2016
|
|
26
42
|
* @version 1.1
|
|
27
43
|
*/
|
|
28
|
-
|
|
44
|
+
class GeoLocation {
|
|
29
45
|
/**
|
|
30
46
|
* GeoLocation constructor with parameters for all required fields.
|
|
31
47
|
*
|
|
@@ -36,7 +52,7 @@ export class GeoLocation {
|
|
|
36
52
|
* <b>Note: </b> For latitudes south of the equator, a negative value should be used.
|
|
37
53
|
* @param {number} longitude
|
|
38
54
|
* double the longitude in a double format such as -74.222130 for Lakewood, NJ.
|
|
39
|
-
* <b>Note: </b> For longitudes
|
|
55
|
+
* <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime
|
|
40
56
|
* Meridian </a> (Greenwich), a negative value should be used.
|
|
41
57
|
* @param {number} elevation
|
|
42
58
|
* the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating
|
|
@@ -143,6 +159,7 @@ export class GeoLocation {
|
|
|
143
159
|
this.timeZoneId = timeZoneId;
|
|
144
160
|
}
|
|
145
161
|
}
|
|
162
|
+
exports.GeoLocation = GeoLocation;
|
|
146
163
|
/**
|
|
147
164
|
* The commonly used average solar refraction. Calendrical Calculations lists a more accurate global average of
|
|
148
165
|
* 34.478885263888294
|
|
@@ -174,7 +191,7 @@ const earthRadius = 6356.9; // in KM
|
|
|
174
191
|
*
|
|
175
192
|
* @author © Eliyahu Hershfeld 2011 - 2019
|
|
176
193
|
*/
|
|
177
|
-
|
|
194
|
+
class NOAACalculator {
|
|
178
195
|
/**
|
|
179
196
|
* A constructor that takes in <a href="http://en.wikipedia.org/wiki/Geolocation">geolocation</a> information as a
|
|
180
197
|
* parameter. The default {@link AstronomicalCalculator#getDefault() AstronomicalCalculator} used for solar
|
|
@@ -1050,6 +1067,7 @@ export class NOAACalculator {
|
|
|
1050
1067
|
return timeUTC;
|
|
1051
1068
|
}
|
|
1052
1069
|
}
|
|
1070
|
+
exports.NOAACalculator = NOAACalculator;
|
|
1053
1071
|
/**
|
|
1054
1072
|
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
1055
1073
|
* @private
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Temporal } from 'temporal-polyfill';
|
|
2
1
|
/**
|
|
3
2
|
* A class that contains location information such as latitude and longitude required for astronomical calculations. The
|
|
4
3
|
* elevation field may not be used by some calculation engines and would be ignored if set. Check the documentation for
|
|
@@ -19,7 +18,7 @@ export declare class GeoLocation {
|
|
|
19
18
|
* <b>Note: </b> For latitudes south of the equator, a negative value should be used.
|
|
20
19
|
* @param {number} longitude
|
|
21
20
|
* double the longitude in a double format such as -74.222130 for Lakewood, NJ.
|
|
22
|
-
* <b>Note: </b> For longitudes
|
|
21
|
+
* <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime
|
|
23
22
|
* Meridian </a> (Greenwich), a negative value should be used.
|
|
24
23
|
* @param {number} elevation
|
|
25
24
|
* the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/noaa",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "sunrise and sunset via NOAA algorithm with elevation, based on KosherJava",
|
|
5
5
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
6
6
|
"contributors": [
|
|
@@ -40,11 +40,9 @@
|
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/node": "20.
|
|
43
|
+
"@types/node": "20.10.0",
|
|
44
44
|
"gts": "^5.2.0",
|
|
45
|
+
"temporal-polyfill": "^0.1.1",
|
|
45
46
|
"typescript": "^5.3.2"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"temporal-polyfill": "^0.1.1"
|
|
49
47
|
}
|
|
50
48
|
}
|