metar-taf-parser 5.0.0 → 5.1.0
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/metar-taf-parser.d.ts +5 -0
- package/metar-taf-parser.js +7 -0
- package/package.json +1 -1
package/metar-taf-parser.d.ts
CHANGED
|
@@ -1171,9 +1171,14 @@ interface ITAF extends IAbstractWeatherCode {
|
|
|
1171
1171
|
maxTemperature?: ITemperatureDated;
|
|
1172
1172
|
minTemperature?: ITemperatureDated;
|
|
1173
1173
|
trends: TAFTrend[];
|
|
1174
|
+
/**
|
|
1175
|
+
* Just the first part of the TAF message without trends (FM, BECMG, etc)
|
|
1176
|
+
*/
|
|
1177
|
+
initialRaw: string;
|
|
1174
1178
|
}
|
|
1175
1179
|
interface IAbstractTrend extends IAbstractWeatherContainer {
|
|
1176
1180
|
type: WeatherChangeType;
|
|
1181
|
+
raw: string;
|
|
1177
1182
|
}
|
|
1178
1183
|
interface IMetarTrendTime extends ITime {
|
|
1179
1184
|
type: TimeIndicator;
|
package/metar-taf-parser.js
CHANGED
|
@@ -2304,6 +2304,7 @@ class MetarParser extends AbstractParser {
|
|
|
2304
2304
|
clouds: [],
|
|
2305
2305
|
times: [],
|
|
2306
2306
|
remarks: [],
|
|
2307
|
+
raw: input,
|
|
2307
2308
|
};
|
|
2308
2309
|
index = this.parseTrend(index, trend, metarTab);
|
|
2309
2310
|
metar.trends.push(trend);
|
|
@@ -2369,6 +2370,7 @@ class TAFParser extends AbstractParser {
|
|
|
2369
2370
|
remarks: [],
|
|
2370
2371
|
clouds: [],
|
|
2371
2372
|
weatherConditions: [],
|
|
2373
|
+
initialRaw: lines[0].join(" "),
|
|
2372
2374
|
};
|
|
2373
2375
|
for (let i = index + 1; i < lines[0].length; i++) {
|
|
2374
2376
|
const token = lines[0][i];
|
|
@@ -2435,6 +2437,7 @@ class TAFParser extends AbstractParser {
|
|
|
2435
2437
|
...this.makeEmptyTAFTrend(),
|
|
2436
2438
|
type: WeatherChangeType.FM,
|
|
2437
2439
|
validity: parseFromValidity(lineTokens[0]),
|
|
2440
|
+
raw: lineTokens.join(" "),
|
|
2438
2441
|
};
|
|
2439
2442
|
}
|
|
2440
2443
|
else if (lineTokens[0].startsWith(this.PROB)) {
|
|
@@ -2445,12 +2448,14 @@ class TAFParser extends AbstractParser {
|
|
|
2445
2448
|
...this.makeEmptyTAFTrend(),
|
|
2446
2449
|
type: WeatherChangeType.PROB,
|
|
2447
2450
|
validity,
|
|
2451
|
+
raw: lineTokens.join(" "),
|
|
2448
2452
|
};
|
|
2449
2453
|
if (lineTokens.length > 1 && lineTokens[1] === this.TEMPO) {
|
|
2450
2454
|
trend = {
|
|
2451
2455
|
...this.makeEmptyTAFTrend(),
|
|
2452
2456
|
type: WeatherChangeType[lineTokens[1]],
|
|
2453
2457
|
validity,
|
|
2458
|
+
raw: lineTokens.join(" "),
|
|
2454
2459
|
};
|
|
2455
2460
|
index = 2;
|
|
2456
2461
|
}
|
|
@@ -2464,6 +2469,7 @@ class TAFParser extends AbstractParser {
|
|
|
2464
2469
|
...this.makeEmptyTAFTrend(),
|
|
2465
2470
|
type: WeatherChangeType[lineTokens[0]],
|
|
2466
2471
|
validity,
|
|
2472
|
+
raw: lineTokens.join(" "),
|
|
2467
2473
|
};
|
|
2468
2474
|
}
|
|
2469
2475
|
this.parseTrend(index, lineTokens, trend);
|
|
@@ -2654,6 +2660,7 @@ function makeInitialForecast(taf) {
|
|
|
2654
2660
|
remarks: taf.remarks,
|
|
2655
2661
|
clouds: taf.clouds,
|
|
2656
2662
|
weatherConditions: taf.weatherConditions,
|
|
2663
|
+
raw: taf.initialRaw,
|
|
2657
2664
|
validity: {
|
|
2658
2665
|
// End day/hour are for end of the entire TAF
|
|
2659
2666
|
startDay: taf.validity.startDay,
|