@saber-usa/node-common 1.7.31 → 1.7.32

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 +1 -1
  2. package/src/astro.js +8 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.31",
3
+ "version": "1.7.32",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/astro.js CHANGED
@@ -145,24 +145,24 @@ const validateTle = (line1, line2) => {
145
145
  * @return {boolean} true if the propagation output is valid, false otherwise
146
146
  */
147
147
  const isPropagateValid = (out) => {
148
- if (out === null || out === undefined) {
148
+ if (!isDefined(out)) {
149
149
  return false;
150
150
  }
151
151
 
152
152
  if (out.position) {
153
153
  const pos = out.position;
154
- if (pos.x === null || pos.x === undefined || Number.isNaN(pos.x)
155
- || pos.y === null || pos.y === undefined || Number.isNaN(pos.y)
156
- || pos.z === null || pos.z === undefined || Number.isNaN(pos.z)) {
154
+ if (!isDefined(pos.x) || Number.isNaN(pos.x)
155
+ || !isDefined(pos.y) || Number.isNaN(pos.y)
156
+ || !isDefined(pos.z) || Number.isNaN(pos.z)) {
157
157
  return false;
158
158
  }
159
159
  }
160
160
 
161
161
  if (out.velocity) {
162
162
  const vel = out.velocity;
163
- if (vel.x === null || vel.x === undefined || Number.isNaN(vel.x)
164
- || vel.y === null || vel.y === undefined || Number.isNaN(vel.y)
165
- || vel.z === null || vel.z === undefined || Number.isNaN(vel.z)) {
163
+ if (!isDefined(vel.x) || Number.isNaN(vel.x)
164
+ || !isDefined(vel.y) || Number.isNaN(vel.y)
165
+ || !isDefined(vel.z) || Number.isNaN(vel.z)) {
166
166
  return false;
167
167
  }
168
168
  }
@@ -1391,7 +1391,7 @@ const GetElsetUdlFromTle = (
1391
1391
  // and we may be unsure of entering true or false for any reason.
1392
1392
  if (isBoolean(isUct)) {
1393
1393
  elset.uct = isUct;
1394
- } else if (isUct === null || isUct === undefined) {
1394
+ } else if (!isDefined(isUct)) {
1395
1395
  // Do nothing, do not populate nor put null.
1396
1396
  } else {
1397
1397
  throw new Error("Input uct flag is not of type boolean.");