atmosx-nwws-parser 1.0.20233 → 1.0.20234

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 (39) hide show
  1. package/dist/cjs/bootstrap.cjs +1 -0
  2. package/dist/cjs/database.cjs +1 -0
  3. package/dist/cjs/eas.cjs +18 -5
  4. package/dist/cjs/helper.cjs +21 -6
  5. package/dist/cjs/parsers/events.cjs +18 -5
  6. package/dist/cjs/parsers/stanza.cjs +1 -0
  7. package/dist/cjs/parsers/text.cjs +1 -0
  8. package/dist/cjs/parsers/types/api.cjs +18 -5
  9. package/dist/cjs/parsers/types/cap.cjs +18 -5
  10. package/dist/cjs/parsers/types/text.cjs +18 -5
  11. package/dist/cjs/parsers/types/ugc.cjs +18 -5
  12. package/dist/cjs/parsers/types/vtec.cjs +18 -5
  13. package/dist/cjs/parsers/ugc.cjs +1 -0
  14. package/dist/cjs/parsers/vtec.cjs +1 -0
  15. package/dist/cjs/utils.cjs +18 -5
  16. package/dist/cjs/xmpp.cjs +18 -5
  17. package/dist/esm/bootstrap.mjs +1 -0
  18. package/dist/esm/database.mjs +1 -0
  19. package/dist/esm/eas.mjs +18 -5
  20. package/dist/esm/helper.mjs +21 -6
  21. package/dist/esm/parsers/events.mjs +18 -5
  22. package/dist/esm/parsers/stanza.mjs +1 -0
  23. package/dist/esm/parsers/text.mjs +1 -0
  24. package/dist/esm/parsers/types/api.mjs +18 -5
  25. package/dist/esm/parsers/types/cap.mjs +18 -5
  26. package/dist/esm/parsers/types/text.mjs +18 -5
  27. package/dist/esm/parsers/types/ugc.mjs +18 -5
  28. package/dist/esm/parsers/types/vtec.mjs +18 -5
  29. package/dist/esm/parsers/ugc.mjs +1 -0
  30. package/dist/esm/parsers/vtec.mjs +1 -0
  31. package/dist/esm/utils.mjs +18 -5
  32. package/dist/esm/xmpp.mjs +18 -5
  33. package/package.json +1 -1
  34. package/src/bootstrap.ts +1 -0
  35. package/src/helper.ts +1 -1
  36. package/src/parsers/types/api.ts +7 -1
  37. package/src/parsers/types/cap.ts +7 -1
  38. package/src/types.ts +1 -0
  39. package/src/utils.ts +3 -3
@@ -884,6 +884,7 @@ var cache = {
884
884
  var settings = {
885
885
  database: path.join(process.cwd(), "shapefiles.db"),
886
886
  isNWWS: true,
887
+ catchUnhandledExceptions: false,
887
888
  NoaaWeatherWireService: {
888
889
  clientReconnections: {
889
890
  canReconnect: true,
@@ -904,6 +904,7 @@ var cache = {
904
904
  var settings = {
905
905
  database: path.join(process.cwd(), "shapefiles.db"),
906
906
  isNWWS: true,
907
+ catchUnhandledExceptions: false,
907
908
  NoaaWeatherWireService: {
908
909
  clientReconnections: {
909
910
  canReconnect: true,
package/dist/cjs/eas.cjs CHANGED
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1700,7 +1701,13 @@ var CapAlerts = class {
1700
1701
  discussion_wind_intensity: `N/A`,
1701
1702
  discussion_hail_intensity: `N/A`
1702
1703
  },
1703
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1704
+ geometry: extracted.polygon ? {
1705
+ type: `Polygon`,
1706
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1707
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1708
+ return [lat, lon];
1709
+ })
1710
+ } : null
1704
1711
  }
1705
1712
  });
1706
1713
  }
@@ -1727,7 +1734,7 @@ var APIAlerts = class {
1727
1734
  }
1728
1735
  static event(validated) {
1729
1736
  return __async(this, null, function* () {
1730
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1737
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1731
1738
  let processed = [];
1732
1739
  const messages = Object.values(JSON.parse(validated.message).features);
1733
1740
  for (let feature of messages) {
@@ -1777,7 +1784,13 @@ var APIAlerts = class {
1777
1784
  peakWindGust: `N/A`,
1778
1785
  peakHailSize: `N/A`
1779
1786
  },
1780
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1787
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1788
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1789
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1790
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1791
+ return [lat, lon];
1792
+ })
1793
+ } : null
1781
1794
  }
1782
1795
  });
1783
1796
  }
@@ -2330,8 +2343,8 @@ var Utils = class {
2330
2343
  * @static
2331
2344
  */
2332
2345
  static detectUncaughtExceptions() {
2333
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2334
- process.on(`uncaughtException`, (error) => {
2346
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2347
+ cache.events.on("uncaughtException", (error) => {
2335
2348
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2336
2349
  });
2337
2350
  }
@@ -941,6 +941,7 @@ var cache = {
941
941
  var settings = {
942
942
  database: path.join(process.cwd(), "shapefiles.db"),
943
943
  isNWWS: true,
944
+ catchUnhandledExceptions: false,
944
945
  NoaaWeatherWireService: {
945
946
  clientReconnections: {
946
947
  canReconnect: true,
@@ -1711,7 +1712,13 @@ var CapAlerts = class {
1711
1712
  discussion_wind_intensity: `N/A`,
1712
1713
  discussion_hail_intensity: `N/A`
1713
1714
  },
1714
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1715
+ geometry: extracted.polygon ? {
1716
+ type: `Polygon`,
1717
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1718
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1719
+ return [lat, lon];
1720
+ })
1721
+ } : null
1715
1722
  }
1716
1723
  });
1717
1724
  }
@@ -1738,7 +1745,7 @@ var APIAlerts = class {
1738
1745
  }
1739
1746
  static event(validated) {
1740
1747
  return __async(this, null, function* () {
1741
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1748
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1742
1749
  let processed = [];
1743
1750
  const messages = Object.values(JSON.parse(validated.message).features);
1744
1751
  for (let feature of messages) {
@@ -1788,7 +1795,13 @@ var APIAlerts = class {
1788
1795
  peakWindGust: `N/A`,
1789
1796
  peakHailSize: `N/A`
1790
1797
  },
1791
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1798
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1799
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1800
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1801
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1802
+ return [lat, lon];
1803
+ })
1804
+ } : null
1792
1805
  }
1793
1806
  });
1794
1807
  }
@@ -2754,8 +2767,8 @@ var Utils = class {
2754
2767
  * @static
2755
2768
  */
2756
2769
  static detectUncaughtExceptions() {
2757
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2758
- process.on(`uncaughtException`, (error) => {
2770
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2771
+ cache.events.on("uncaughtException", (error) => {
2759
2772
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2760
2773
  });
2761
2774
  }
@@ -2978,7 +2991,9 @@ var AlertManager = class {
2978
2991
  return Promise.resolve();
2979
2992
  }
2980
2993
  this.setSettings(metadata);
2981
- utils_default.detectUncaughtExceptions();
2994
+ if (settings.catchUnhandledExceptions) {
2995
+ utils_default.detectUncaughtExceptions();
2996
+ }
2982
2997
  const settings2 = settings;
2983
2998
  this.isNoaaWeatherWireService = settings.isNWWS;
2984
2999
  cache.isReady = false;
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1598,7 +1599,13 @@ var CapAlerts = class {
1598
1599
  discussion_wind_intensity: `N/A`,
1599
1600
  discussion_hail_intensity: `N/A`
1600
1601
  },
1601
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1602
+ geometry: extracted.polygon ? {
1603
+ type: `Polygon`,
1604
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1605
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1606
+ return [lat, lon];
1607
+ })
1608
+ } : null
1602
1609
  }
1603
1610
  });
1604
1611
  }
@@ -1625,7 +1632,7 @@ var APIAlerts = class {
1625
1632
  }
1626
1633
  static event(validated) {
1627
1634
  return __async(this, null, function* () {
1628
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1635
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1629
1636
  let processed = [];
1630
1637
  const messages = Object.values(JSON.parse(validated.message).features);
1631
1638
  for (let feature of messages) {
@@ -1675,7 +1682,13 @@ var APIAlerts = class {
1675
1682
  peakWindGust: `N/A`,
1676
1683
  peakHailSize: `N/A`
1677
1684
  },
1678
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1685
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1686
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1687
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1688
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1689
+ return [lat, lon];
1690
+ })
1691
+ } : null
1679
1692
  }
1680
1693
  });
1681
1694
  }
@@ -2062,8 +2075,8 @@ var Utils = class {
2062
2075
  * @static
2063
2076
  */
2064
2077
  static detectUncaughtExceptions() {
2065
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2066
- process.on(`uncaughtException`, (error) => {
2078
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2079
+ cache.events.on("uncaughtException", (error) => {
2067
2080
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2068
2081
  });
2069
2082
  }
@@ -884,6 +884,7 @@ var cache = {
884
884
  var settings = {
885
885
  database: path.join(process.cwd(), "shapefiles.db"),
886
886
  isNWWS: true,
887
+ catchUnhandledExceptions: false,
887
888
  NoaaWeatherWireService: {
888
889
  clientReconnections: {
889
890
  canReconnect: true,
@@ -867,6 +867,7 @@ var cache = {
867
867
  var settings = {
868
868
  database: path.join(process.cwd(), "shapefiles.db"),
869
869
  isNWWS: true,
870
+ catchUnhandledExceptions: false,
870
871
  NoaaWeatherWireService: {
871
872
  clientReconnections: {
872
873
  canReconnect: true,
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1598,7 +1599,13 @@ var CapAlerts = class {
1598
1599
  discussion_wind_intensity: `N/A`,
1599
1600
  discussion_hail_intensity: `N/A`
1600
1601
  },
1601
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1602
+ geometry: extracted.polygon ? {
1603
+ type: `Polygon`,
1604
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1605
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1606
+ return [lat, lon];
1607
+ })
1608
+ } : null
1602
1609
  }
1603
1610
  });
1604
1611
  }
@@ -1985,8 +1992,8 @@ var Utils = class {
1985
1992
  * @static
1986
1993
  */
1987
1994
  static detectUncaughtExceptions() {
1988
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
1989
- process.on(`uncaughtException`, (error) => {
1995
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
1996
+ cache.events.on("uncaughtException", (error) => {
1990
1997
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
1991
1998
  });
1992
1999
  }
@@ -2802,7 +2809,7 @@ var APIAlerts = class {
2802
2809
  }
2803
2810
  static event(validated) {
2804
2811
  return __async(this, null, function* () {
2805
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
2812
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
2806
2813
  let processed = [];
2807
2814
  const messages = Object.values(JSON.parse(validated.message).features);
2808
2815
  for (let feature of messages) {
@@ -2852,7 +2859,13 @@ var APIAlerts = class {
2852
2859
  peakWindGust: `N/A`,
2853
2860
  peakHailSize: `N/A`
2854
2861
  },
2855
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
2862
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
2863
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
2864
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
2865
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
2866
+ return [lat, lon];
2867
+ })
2868
+ } : null
2856
2869
  }
2857
2870
  });
2858
2871
  }
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1540,7 +1541,7 @@ var APIAlerts = class {
1540
1541
  }
1541
1542
  static event(validated) {
1542
1543
  return __async(this, null, function* () {
1543
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1544
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1544
1545
  let processed = [];
1545
1546
  const messages = Object.values(JSON.parse(validated.message).features);
1546
1547
  for (let feature of messages) {
@@ -1590,7 +1591,13 @@ var APIAlerts = class {
1590
1591
  peakWindGust: `N/A`,
1591
1592
  peakHailSize: `N/A`
1592
1593
  },
1593
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1594
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1595
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1596
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1597
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1598
+ return [lat, lon];
1599
+ })
1600
+ } : null
1594
1601
  }
1595
1602
  });
1596
1603
  }
@@ -1977,8 +1984,8 @@ var Utils = class {
1977
1984
  * @static
1978
1985
  */
1979
1986
  static detectUncaughtExceptions() {
1980
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
1981
- process.on(`uncaughtException`, (error) => {
1987
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
1988
+ cache.events.on("uncaughtException", (error) => {
1982
1989
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
1983
1990
  });
1984
1991
  }
@@ -2852,7 +2859,13 @@ var CapAlerts = class {
2852
2859
  discussion_wind_intensity: `N/A`,
2853
2860
  discussion_hail_intensity: `N/A`
2854
2861
  },
2855
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
2862
+ geometry: extracted.polygon ? {
2863
+ type: `Polygon`,
2864
+ coordinates: extracted.polygon.split(` `).map((coord) => {
2865
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
2866
+ return [lat, lon];
2867
+ })
2868
+ } : null
2856
2869
  }
2857
2870
  });
2858
2871
  }
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1561,7 +1562,13 @@ var CapAlerts = class {
1561
1562
  discussion_wind_intensity: `N/A`,
1562
1563
  discussion_hail_intensity: `N/A`
1563
1564
  },
1564
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1565
+ geometry: extracted.polygon ? {
1566
+ type: `Polygon`,
1567
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1568
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1569
+ return [lat, lon];
1570
+ })
1571
+ } : null
1565
1572
  }
1566
1573
  });
1567
1574
  }
@@ -1588,7 +1595,7 @@ var APIAlerts = class {
1588
1595
  }
1589
1596
  static event(validated) {
1590
1597
  return __async(this, null, function* () {
1591
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1598
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1592
1599
  let processed = [];
1593
1600
  const messages = Object.values(JSON.parse(validated.message).features);
1594
1601
  for (let feature of messages) {
@@ -1638,7 +1645,13 @@ var APIAlerts = class {
1638
1645
  peakWindGust: `N/A`,
1639
1646
  peakHailSize: `N/A`
1640
1647
  },
1641
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1648
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1649
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1650
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1651
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1652
+ return [lat, lon];
1653
+ })
1654
+ } : null
1642
1655
  }
1643
1656
  });
1644
1657
  }
@@ -2025,8 +2038,8 @@ var Utils = class {
2025
2038
  * @static
2026
2039
  */
2027
2040
  static detectUncaughtExceptions() {
2028
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2029
- process.on(`uncaughtException`, (error) => {
2041
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2042
+ cache.events.on("uncaughtException", (error) => {
2030
2043
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2031
2044
  });
2032
2045
  }
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1531,7 +1532,13 @@ var CapAlerts = class {
1531
1532
  discussion_wind_intensity: `N/A`,
1532
1533
  discussion_hail_intensity: `N/A`
1533
1534
  },
1534
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1535
+ geometry: extracted.polygon ? {
1536
+ type: `Polygon`,
1537
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1538
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1539
+ return [lat, lon];
1540
+ })
1541
+ } : null
1535
1542
  }
1536
1543
  });
1537
1544
  }
@@ -1558,7 +1565,7 @@ var APIAlerts = class {
1558
1565
  }
1559
1566
  static event(validated) {
1560
1567
  return __async(this, null, function* () {
1561
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1568
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1562
1569
  let processed = [];
1563
1570
  const messages = Object.values(JSON.parse(validated.message).features);
1564
1571
  for (let feature of messages) {
@@ -1608,7 +1615,13 @@ var APIAlerts = class {
1608
1615
  peakWindGust: `N/A`,
1609
1616
  peakHailSize: `N/A`
1610
1617
  },
1611
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1618
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1619
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1620
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1621
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1622
+ return [lat, lon];
1623
+ })
1624
+ } : null
1612
1625
  }
1613
1626
  });
1614
1627
  }
@@ -1995,8 +2008,8 @@ var Utils = class {
1995
2008
  * @static
1996
2009
  */
1997
2010
  static detectUncaughtExceptions() {
1998
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
1999
- process.on(`uncaughtException`, (error) => {
2011
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2012
+ cache.events.on("uncaughtException", (error) => {
2000
2013
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2001
2014
  });
2002
2015
  }
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1554,7 +1555,13 @@ var CapAlerts = class {
1554
1555
  discussion_wind_intensity: `N/A`,
1555
1556
  discussion_hail_intensity: `N/A`
1556
1557
  },
1557
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1558
+ geometry: extracted.polygon ? {
1559
+ type: `Polygon`,
1560
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1561
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1562
+ return [lat, lon];
1563
+ })
1564
+ } : null
1558
1565
  }
1559
1566
  });
1560
1567
  }
@@ -1581,7 +1588,7 @@ var APIAlerts = class {
1581
1588
  }
1582
1589
  static event(validated) {
1583
1590
  return __async(this, null, function* () {
1584
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1591
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1585
1592
  let processed = [];
1586
1593
  const messages = Object.values(JSON.parse(validated.message).features);
1587
1594
  for (let feature of messages) {
@@ -1631,7 +1638,13 @@ var APIAlerts = class {
1631
1638
  peakWindGust: `N/A`,
1632
1639
  peakHailSize: `N/A`
1633
1640
  },
1634
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1641
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1642
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1643
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1644
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1645
+ return [lat, lon];
1646
+ })
1647
+ } : null
1635
1648
  }
1636
1649
  });
1637
1650
  }
@@ -2018,8 +2031,8 @@ var Utils = class {
2018
2031
  * @static
2019
2032
  */
2020
2033
  static detectUncaughtExceptions() {
2021
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2022
- process.on(`uncaughtException`, (error) => {
2034
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2035
+ cache.events.on("uncaughtException", (error) => {
2023
2036
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2024
2037
  });
2025
2038
  }
@@ -887,6 +887,7 @@ var cache = {
887
887
  var settings = {
888
888
  database: path.join(process.cwd(), "shapefiles.db"),
889
889
  isNWWS: true,
890
+ catchUnhandledExceptions: false,
890
891
  NoaaWeatherWireService: {
891
892
  clientReconnections: {
892
893
  canReconnect: true,
@@ -887,6 +887,7 @@ var cache = {
887
887
  var settings = {
888
888
  database: path.join(process.cwd(), "shapefiles.db"),
889
889
  isNWWS: true,
890
+ catchUnhandledExceptions: false,
890
891
  NoaaWeatherWireService: {
891
892
  clientReconnections: {
892
893
  canReconnect: true,
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1700,7 +1701,13 @@ var CapAlerts = class {
1700
1701
  discussion_wind_intensity: `N/A`,
1701
1702
  discussion_hail_intensity: `N/A`
1702
1703
  },
1703
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1704
+ geometry: extracted.polygon ? {
1705
+ type: `Polygon`,
1706
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1707
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1708
+ return [lat, lon];
1709
+ })
1710
+ } : null
1704
1711
  }
1705
1712
  });
1706
1713
  }
@@ -1727,7 +1734,7 @@ var APIAlerts = class {
1727
1734
  }
1728
1735
  static event(validated) {
1729
1736
  return __async(this, null, function* () {
1730
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1737
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1731
1738
  let processed = [];
1732
1739
  const messages = Object.values(JSON.parse(validated.message).features);
1733
1740
  for (let feature of messages) {
@@ -1777,7 +1784,13 @@ var APIAlerts = class {
1777
1784
  peakWindGust: `N/A`,
1778
1785
  peakHailSize: `N/A`
1779
1786
  },
1780
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1787
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1788
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1789
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1790
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1791
+ return [lat, lon];
1792
+ })
1793
+ } : null
1781
1794
  }
1782
1795
  });
1783
1796
  }
@@ -2743,8 +2756,8 @@ var Utils = class {
2743
2756
  * @static
2744
2757
  */
2745
2758
  static detectUncaughtExceptions() {
2746
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2747
- process.on(`uncaughtException`, (error) => {
2759
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2760
+ cache.events.on("uncaughtException", (error) => {
2748
2761
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2749
2762
  });
2750
2763
  }
package/dist/cjs/xmpp.cjs CHANGED
@@ -933,6 +933,7 @@ var cache = {
933
933
  var settings = {
934
934
  database: path.join(process.cwd(), "shapefiles.db"),
935
935
  isNWWS: true,
936
+ catchUnhandledExceptions: false,
936
937
  NoaaWeatherWireService: {
937
938
  clientReconnections: {
938
939
  canReconnect: true,
@@ -1700,7 +1701,13 @@ var CapAlerts = class {
1700
1701
  discussion_wind_intensity: `N/A`,
1701
1702
  discussion_hail_intensity: `N/A`
1702
1703
  },
1703
- geometry: extracted.polygon ? { type: `Polygon`, coordinates: extracted.polygon.split(` `).map((coord) => coord.split(`,`).map((num) => parseFloat(num))) } : null
1704
+ geometry: extracted.polygon ? {
1705
+ type: `Polygon`,
1706
+ coordinates: extracted.polygon.split(` `).map((coord) => {
1707
+ const [lon, lat] = coord.split(`,`).map((num) => parseFloat(num));
1708
+ return [lat, lon];
1709
+ })
1710
+ } : null
1704
1711
  }
1705
1712
  });
1706
1713
  }
@@ -1727,7 +1734,7 @@ var APIAlerts = class {
1727
1734
  }
1728
1735
  static event(validated) {
1729
1736
  return __async(this, null, function* () {
1730
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca;
1737
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
1731
1738
  let processed = [];
1732
1739
  const messages = Object.values(JSON.parse(validated.message).features);
1733
1740
  for (let feature of messages) {
@@ -1777,7 +1784,13 @@ var APIAlerts = class {
1777
1784
  peakWindGust: `N/A`,
1778
1785
  peakHailSize: `N/A`
1779
1786
  },
1780
- geometry: (_ca = feature == null ? void 0 : feature.geometry) != null ? _ca : null
1787
+ geometry: ((_ea = (_da = (_ca = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ca.coordinates) == null ? void 0 : _da[0]) == null ? void 0 : _ea.length) ? {
1788
+ type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
1789
+ coordinates: (_ia = (_ha = (_ga = feature == null ? void 0 : feature.geometry) == null ? void 0 : _ga.coordinates) == null ? void 0 : _ha[0]) == null ? void 0 : _ia.map((coord) => {
1790
+ const [lon, lat] = Array.isArray(coord) ? coord : [0, 0];
1791
+ return [lat, lon];
1792
+ })
1793
+ } : null
1781
1794
  }
1782
1795
  });
1783
1796
  }
@@ -2547,8 +2560,8 @@ var Utils = class {
2547
2560
  * @static
2548
2561
  */
2549
2562
  static detectUncaughtExceptions() {
2550
- if (process.listeners("uncaughtException").some((l) => l.name === "uncaughtExceptionHandler")) return;
2551
- process.on(`uncaughtException`, (error) => {
2563
+ if (cache.events.listenerCount("uncaughtException") > 0) return;
2564
+ cache.events.on("uncaughtException", (error) => {
2552
2565
  cache.events.emit(`onError`, { message: `Uncaught Exception: ${error.message}`, code: `error-uncaught-exception`, stack: error.stack });
2553
2566
  });
2554
2567
  }
@@ -848,6 +848,7 @@ var cache = {
848
848
  var settings = {
849
849
  database: path.join(process.cwd(), "shapefiles.db"),
850
850
  isNWWS: true,
851
+ catchUnhandledExceptions: false,
851
852
  NoaaWeatherWireService: {
852
853
  clientReconnections: {
853
854
  canReconnect: true,