@saber-usa/node-common 1.7.9-alpha.2 → 1.7.9-alpha.3

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/astro.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.9-alpha.2",
3
+ "version": "1.7.9-alpha.3",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -29,9 +29,9 @@
29
29
  "winston": "3.3.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "7.16.0",
33
- "@babel/eslint-parser": "7.16.3",
34
- "@babel/plugin-transform-modules-commonjs": "7.16.0",
32
+ "@babel/core": "7.23.0",
33
+ "@babel/eslint-parser": "^7.23.0",
34
+ "@babel/plugin-transform-modules-commonjs": "7.23.0",
35
35
  "@jest/globals": "27.4.4",
36
36
  "eslint-config-google": "0.14.0",
37
37
  "eslint-plugin-jest": "25.3.0",
package/src/astro.js CHANGED
@@ -1057,6 +1057,16 @@ const RaDecToGeodetic = (
1057
1057
  * @return {Number} range The range from the sensor to the satellite
1058
1058
  */
1059
1059
  const estimateSlantRange = (obTime, ra, dec, senLat, senLon, senAltKm) => {
1060
+ // check for nulls
1061
+ if (!isDefined(obTime)
1062
+ || !isDefined(ra)
1063
+ || !isDefined(dec)
1064
+ || !isDefined(senLat)
1065
+ || !isDefined(senLon)
1066
+ || !isDefined(senAltKm)) {
1067
+ return null;
1068
+ }
1069
+
1060
1070
  // A very rough initial guess, akso initialization
1061
1071
  let range = 35786;
1062
1072