atmosx-nwws-parser 1.0.20234 → 1.0.20311
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/dist/cjs/{helper.cjs → index.cjs} +10 -10
- package/dist/esm/{helper.mjs → index.mjs} +6 -6
- package/package.json +3 -2
- package/src/parsers/text.ts +1 -1
- package/src/parsers/types/api.ts +2 -2
- package/src/parsers/types/cap.ts +1 -1
- package/tsup.config.ts +10 -7
- package/dist/cjs/bootstrap.cjs +0 -1001
- package/dist/cjs/database.cjs +0 -1106
- package/dist/cjs/dictionaries/awips.cjs +0 -370
- package/dist/cjs/dictionaries/events.cjs +0 -139
- package/dist/cjs/dictionaries/icao.cjs +0 -265
- package/dist/cjs/dictionaries/offshore.cjs +0 -40
- package/dist/cjs/dictionaries/signatures.cjs +0 -132
- package/dist/cjs/eas.cjs +0 -2880
- package/dist/cjs/parsers/events.cjs +0 -2880
- package/dist/cjs/parsers/stanza.cjs +0 -1100
- package/dist/cjs/parsers/text.cjs +0 -1134
- package/dist/cjs/parsers/types/api.cjs +0 -2880
- package/dist/cjs/parsers/types/cap.cjs +0 -2880
- package/dist/cjs/parsers/types/text.cjs +0 -2880
- package/dist/cjs/parsers/types/ugc.cjs +0 -2880
- package/dist/cjs/parsers/types/vtec.cjs +0 -2880
- package/dist/cjs/parsers/ugc.cjs +0 -1131
- package/dist/cjs/parsers/vtec.cjs +0 -1052
- package/dist/cjs/types.cjs +0 -17
- package/dist/cjs/utils.cjs +0 -2880
- package/dist/cjs/xmpp.cjs +0 -2880
- package/dist/esm/bootstrap.mjs +0 -964
- package/dist/esm/database.mjs +0 -1071
- package/dist/esm/dictionaries/awips.mjs +0 -346
- package/dist/esm/dictionaries/events.mjs +0 -111
- package/dist/esm/dictionaries/icao.mjs +0 -241
- package/dist/esm/dictionaries/offshore.mjs +0 -16
- package/dist/esm/dictionaries/signatures.mjs +0 -106
- package/dist/esm/eas.mjs +0 -2847
- package/dist/esm/parsers/events.mjs +0 -2847
- package/dist/esm/parsers/stanza.mjs +0 -1064
- package/dist/esm/parsers/text.mjs +0 -1098
- package/dist/esm/parsers/types/api.mjs +0 -2847
- package/dist/esm/parsers/types/cap.mjs +0 -2847
- package/dist/esm/parsers/types/text.mjs +0 -2847
- package/dist/esm/parsers/types/ugc.mjs +0 -2847
- package/dist/esm/parsers/types/vtec.mjs +0 -2847
- package/dist/esm/parsers/ugc.mjs +0 -1096
- package/dist/esm/parsers/vtec.mjs +0 -1017
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/utils.mjs +0 -2847
- package/dist/esm/xmpp.mjs +0 -2847
- /package/src/{helper.ts → index.ts} +0 -0
|
@@ -75,9 +75,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
// src/
|
|
79
|
-
var
|
|
80
|
-
__export(
|
|
78
|
+
// src/index.ts
|
|
79
|
+
var index_exports = {};
|
|
80
|
+
__export(index_exports, {
|
|
81
81
|
AlertManager: () => AlertManager,
|
|
82
82
|
Database: () => database_default,
|
|
83
83
|
EAS: () => eas_default,
|
|
@@ -86,10 +86,10 @@ __export(helper_exports, {
|
|
|
86
86
|
TextParser: () => text_default,
|
|
87
87
|
UGCParser: () => ugc_default,
|
|
88
88
|
VtecParser: () => vtec_default,
|
|
89
|
-
default: () =>
|
|
89
|
+
default: () => index_default,
|
|
90
90
|
types: () => types_exports
|
|
91
91
|
});
|
|
92
|
-
module.exports = __toCommonJS(
|
|
92
|
+
module.exports = __toCommonJS(index_exports);
|
|
93
93
|
|
|
94
94
|
// src/bootstrap.ts
|
|
95
95
|
var fs = __toESM(require("fs"));
|
|
@@ -1198,7 +1198,7 @@ var TextParser = class {
|
|
|
1198
1198
|
const lat = parseFloat(coordStrings[i]) / 100;
|
|
1199
1199
|
const lon = -parseFloat(coordStrings[i + 1]) / 100;
|
|
1200
1200
|
if (!isNaN(lat) && !isNaN(lon)) {
|
|
1201
|
-
coordinates.push([
|
|
1201
|
+
coordinates.push([lat, lon]);
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
1204
|
if (coordinates.length > 2) {
|
|
@@ -1715,7 +1715,7 @@ var CapAlerts = class {
|
|
|
1715
1715
|
geometry: extracted.polygon ? {
|
|
1716
1716
|
type: `Polygon`,
|
|
1717
1717
|
coordinates: extracted.polygon.split(` `).map((coord) => {
|
|
1718
|
-
const [
|
|
1718
|
+
const [lat, lon] = coord.split(`,`).map((num) => parseFloat(num));
|
|
1719
1719
|
return [lat, lon];
|
|
1720
1720
|
})
|
|
1721
1721
|
} : null
|
|
@@ -1798,7 +1798,7 @@ var APIAlerts = class {
|
|
|
1798
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
1799
|
type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
|
|
1800
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 [
|
|
1801
|
+
const [lat, lon] = Array.isArray(coord) ? coord : [0, 0];
|
|
1802
1802
|
return [lat, lon];
|
|
1803
1803
|
})
|
|
1804
1804
|
} : null
|
|
@@ -2886,7 +2886,7 @@ var Utils = class {
|
|
|
2886
2886
|
};
|
|
2887
2887
|
var utils_default = Utils;
|
|
2888
2888
|
|
|
2889
|
-
// src/
|
|
2889
|
+
// src/index.ts
|
|
2890
2890
|
var AlertManager = class {
|
|
2891
2891
|
constructor(metadata) {
|
|
2892
2892
|
this.start(metadata);
|
|
@@ -3029,7 +3029,7 @@ var AlertManager = class {
|
|
|
3029
3029
|
});
|
|
3030
3030
|
}
|
|
3031
3031
|
};
|
|
3032
|
-
var
|
|
3032
|
+
var index_default = AlertManager;
|
|
3033
3033
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3034
3034
|
0 && (module.exports = {
|
|
3035
3035
|
AlertManager,
|
|
@@ -1157,7 +1157,7 @@ var TextParser = class {
|
|
|
1157
1157
|
const lat = parseFloat(coordStrings[i]) / 100;
|
|
1158
1158
|
const lon = -parseFloat(coordStrings[i + 1]) / 100;
|
|
1159
1159
|
if (!isNaN(lat) && !isNaN(lon)) {
|
|
1160
|
-
coordinates.push([
|
|
1160
|
+
coordinates.push([lat, lon]);
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
1163
|
if (coordinates.length > 2) {
|
|
@@ -1674,7 +1674,7 @@ var CapAlerts = class {
|
|
|
1674
1674
|
geometry: extracted.polygon ? {
|
|
1675
1675
|
type: `Polygon`,
|
|
1676
1676
|
coordinates: extracted.polygon.split(` `).map((coord) => {
|
|
1677
|
-
const [
|
|
1677
|
+
const [lat, lon] = coord.split(`,`).map((num) => parseFloat(num));
|
|
1678
1678
|
return [lat, lon];
|
|
1679
1679
|
})
|
|
1680
1680
|
} : null
|
|
@@ -1757,7 +1757,7 @@ var APIAlerts = class {
|
|
|
1757
1757
|
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) ? {
|
|
1758
1758
|
type: ((_fa = feature == null ? void 0 : feature.geometry) == null ? void 0 : _fa.type) || "Polygon",
|
|
1759
1759
|
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) => {
|
|
1760
|
-
const [
|
|
1760
|
+
const [lat, lon] = Array.isArray(coord) ? coord : [0, 0];
|
|
1761
1761
|
return [lat, lon];
|
|
1762
1762
|
})
|
|
1763
1763
|
} : null
|
|
@@ -2845,7 +2845,7 @@ var Utils = class {
|
|
|
2845
2845
|
};
|
|
2846
2846
|
var utils_default = Utils;
|
|
2847
2847
|
|
|
2848
|
-
// src/
|
|
2848
|
+
// src/index.ts
|
|
2849
2849
|
var AlertManager = class {
|
|
2850
2850
|
constructor(metadata) {
|
|
2851
2851
|
this.start(metadata);
|
|
@@ -2988,7 +2988,7 @@ var AlertManager = class {
|
|
|
2988
2988
|
});
|
|
2989
2989
|
}
|
|
2990
2990
|
};
|
|
2991
|
-
var
|
|
2991
|
+
var index_default = AlertManager;
|
|
2992
2992
|
export {
|
|
2993
2993
|
AlertManager,
|
|
2994
2994
|
database_default as Database,
|
|
@@ -2998,6 +2998,6 @@ export {
|
|
|
2998
2998
|
text_default as TextParser,
|
|
2999
2999
|
ugc_default as UGCParser,
|
|
3000
3000
|
vtec_default as VtecParser,
|
|
3001
|
-
|
|
3001
|
+
index_default as default,
|
|
3002
3002
|
types_exports as types
|
|
3003
3003
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atmosx-nwws-parser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20311",
|
|
4
4
|
"description": "NOAA Weather Wire Parser - Built for standalone and Project AtmosphericX Integration.",
|
|
5
|
-
"main": "dist/cjs/
|
|
5
|
+
"main": "dist/cjs/index.cjs",
|
|
6
|
+
"module": "dist/esm/index.mjs",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/K3YOMI/atmosx-nwws-parser.git",
|
package/src/parsers/text.ts
CHANGED
|
@@ -54,7 +54,7 @@ export class TextParser {
|
|
|
54
54
|
for (let i = 0; i < coordStrings.length - 1; i += 2) {
|
|
55
55
|
const lat = parseFloat(coordStrings[i]) / 100;
|
|
56
56
|
const lon = -parseFloat(coordStrings[i + 1]) / 100;
|
|
57
|
-
if (!isNaN(lat) && !isNaN(lon)) { coordinates.push([
|
|
57
|
+
if (!isNaN(lat) && !isNaN(lon)) { coordinates.push([lat, lon]); }
|
|
58
58
|
}
|
|
59
59
|
if (coordinates.length > 2) { coordinates.push(coordinates[0]); }
|
|
60
60
|
return coordinates;
|
package/src/parsers/types/api.ts
CHANGED
|
@@ -86,8 +86,8 @@ export class APIAlerts {
|
|
|
86
86
|
geometry: feature?.geometry?.coordinates?.[0]?.length ? {
|
|
87
87
|
type: feature?.geometry?.type || 'Polygon',
|
|
88
88
|
coordinates: feature?.geometry?.coordinates?.[0]?.map((coord: number) => {
|
|
89
|
-
const [
|
|
90
|
-
return [lat, lon];
|
|
89
|
+
const [lat, lon] = Array.isArray(coord) ? coord : [0, 0];
|
|
90
|
+
return [lat, lon];
|
|
91
91
|
})
|
|
92
92
|
} : null
|
|
93
93
|
}
|
package/src/parsers/types/cap.ts
CHANGED
|
@@ -81,7 +81,7 @@ export class CapAlerts {
|
|
|
81
81
|
geometry: extracted.polygon ? {
|
|
82
82
|
type: `Polygon`,
|
|
83
83
|
coordinates: extracted.polygon.split(` `).map((coord: string) => {
|
|
84
|
-
const [
|
|
84
|
+
const [lat, lon] = coord.split(`,`).map((num: string) => parseFloat(num));
|
|
85
85
|
return [lat, lon];
|
|
86
86
|
})
|
|
87
87
|
} : null,
|
package/tsup.config.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
entry: ['src
|
|
5
|
-
format: ['esm', 'cjs'],
|
|
4
|
+
entry: ['src/index.ts'],
|
|
6
5
|
outDir: 'dist',
|
|
7
|
-
|
|
6
|
+
format: ['esm', 'cjs'],
|
|
8
7
|
clean: true,
|
|
9
|
-
outExtension({ format }) {
|
|
10
|
-
|
|
11
|
-
}
|
|
8
|
+
outExtension({ format }) {
|
|
9
|
+
return { js: format === 'esm' ? '.mjs' : '.cjs' }
|
|
10
|
+
},
|
|
11
|
+
esbuildOptions(options, context) {
|
|
12
|
+
options.outdir = `dist/${context.format}`
|
|
13
|
+
},
|
|
14
|
+
})
|