metar-taf-parser 6.1.2 → 6.1.4
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/locale/en.d.ts +1 -0
- package/locale/en.js +1 -0
- package/metar-taf-parser.d.ts +3 -7
- package/metar-taf-parser.js +7 -8
- package/package.json +1 -1
package/locale/en.d.ts
CHANGED
package/locale/en.js
CHANGED
package/metar-taf-parser.d.ts
CHANGED
|
@@ -114,7 +114,8 @@ declare enum Phenomenon {
|
|
|
114
114
|
THUNDERSTORM = "TS",
|
|
115
115
|
DUSTSTORM = "DS",
|
|
116
116
|
SANDSTORM = "SS",
|
|
117
|
-
FUNNEL_CLOUD = "FC"
|
|
117
|
+
FUNNEL_CLOUD = "FC",
|
|
118
|
+
NO_SIGNIFICANT_WEATHER = "NSW"
|
|
118
119
|
}
|
|
119
120
|
declare enum TimeIndicator {
|
|
120
121
|
AT = "AT",
|
|
@@ -407,6 +408,7 @@ declare const _default: {
|
|
|
407
408
|
TS: string;
|
|
408
409
|
UP: string;
|
|
409
410
|
VA: string;
|
|
411
|
+
NSW: string;
|
|
410
412
|
};
|
|
411
413
|
Remark: {
|
|
412
414
|
ALQDS: string;
|
|
@@ -1190,12 +1192,6 @@ interface ITAF extends IAbstractWeatherCode {
|
|
|
1190
1192
|
interface IAbstractTrend extends IAbstractWeatherContainer {
|
|
1191
1193
|
type: WeatherChangeType;
|
|
1192
1194
|
raw: string;
|
|
1193
|
-
/**
|
|
1194
|
-
* No Significant Weather
|
|
1195
|
-
*
|
|
1196
|
-
* Flag indicates that previous weather conditions have stopped
|
|
1197
|
-
*/
|
|
1198
|
-
nsw?: true;
|
|
1199
1195
|
}
|
|
1200
1196
|
interface IMetarTrendTime extends ITime {
|
|
1201
1197
|
type: TimeIndicator;
|
package/metar-taf-parser.js
CHANGED
|
@@ -305,6 +305,7 @@ var Phenomenon;
|
|
|
305
305
|
Phenomenon["DUSTSTORM"] = "DS";
|
|
306
306
|
Phenomenon["SANDSTORM"] = "SS";
|
|
307
307
|
Phenomenon["FUNNEL_CLOUD"] = "FC";
|
|
308
|
+
Phenomenon["NO_SIGNIFICANT_WEATHER"] = "NSW";
|
|
308
309
|
})(Phenomenon || (Phenomenon = {}));
|
|
309
310
|
var TimeIndicator;
|
|
310
311
|
(function (TimeIndicator) {
|
|
@@ -1776,6 +1777,8 @@ class CloudCommand {
|
|
|
1776
1777
|
return false;
|
|
1777
1778
|
}
|
|
1778
1779
|
canParse(cloudString) {
|
|
1780
|
+
if (cloudString === "NSW")
|
|
1781
|
+
return false;
|
|
1779
1782
|
return __classPrivateFieldGet(this, _CloudCommand_cloudRegex, "f").test(cloudString);
|
|
1780
1783
|
}
|
|
1781
1784
|
}
|
|
@@ -2304,15 +2307,17 @@ class MetarParser extends AbstractParser {
|
|
|
2304
2307
|
}
|
|
2305
2308
|
else if (metarTab[index] === this.TEMPO ||
|
|
2306
2309
|
metarTab[index] === this.BECMG) {
|
|
2310
|
+
const startIndex = index;
|
|
2307
2311
|
const trend = {
|
|
2308
2312
|
type: WeatherChangeType[metarTab[index]],
|
|
2309
2313
|
weatherConditions: [],
|
|
2310
2314
|
clouds: [],
|
|
2311
2315
|
times: [],
|
|
2312
2316
|
remarks: [],
|
|
2313
|
-
raw:
|
|
2317
|
+
raw: "",
|
|
2314
2318
|
};
|
|
2315
2319
|
index = this.parseTrend(index, trend, metarTab);
|
|
2320
|
+
trend.raw = metarTab.slice(startIndex, index + 1).join(" ");
|
|
2316
2321
|
metar.trends.push(trend);
|
|
2317
2322
|
}
|
|
2318
2323
|
else if (metarTab[index] === this.RMK) {
|
|
@@ -2341,7 +2346,6 @@ class TAFParser extends AbstractParser {
|
|
|
2341
2346
|
this.PROB = "PROB";
|
|
2342
2347
|
this.TX = "TX";
|
|
2343
2348
|
this.TN = "TN";
|
|
2344
|
-
this.NSW = "NSW";
|
|
2345
2349
|
_TAFParser_validityPattern.set(this, /^\d{4}\/\d{4}$/);
|
|
2346
2350
|
}
|
|
2347
2351
|
/**
|
|
@@ -2515,8 +2519,6 @@ class TAFParser extends AbstractParser {
|
|
|
2515
2519
|
parseRemark(trend, line, i, this.locale);
|
|
2516
2520
|
break;
|
|
2517
2521
|
}
|
|
2518
|
-
else if (line[i] === this.NSW)
|
|
2519
|
-
trend.nsw = true;
|
|
2520
2522
|
// already parsed
|
|
2521
2523
|
else if (__classPrivateFieldGet(this, _TAFParser_validityPattern, "f").test(line[i]))
|
|
2522
2524
|
continue;
|
|
@@ -2760,16 +2762,13 @@ function hydrateWithPreviousContextIfNeeded(forecast, context) {
|
|
|
2760
2762
|
context = { ...context };
|
|
2761
2763
|
delete context.remark;
|
|
2762
2764
|
context.remarks = [];
|
|
2763
|
-
delete context.nsw;
|
|
2764
2765
|
forecast = {
|
|
2765
2766
|
...context,
|
|
2766
2767
|
...forecast,
|
|
2767
2768
|
};
|
|
2768
2769
|
if (!forecast.clouds.length)
|
|
2769
2770
|
forecast.clouds = context.clouds;
|
|
2770
|
-
|
|
2771
|
-
// not be carried over
|
|
2772
|
-
if (!forecast.weatherConditions.length && !forecast.nsw)
|
|
2771
|
+
if (!forecast.weatherConditions.length)
|
|
2773
2772
|
forecast.weatherConditions = context.weatherConditions;
|
|
2774
2773
|
return forecast;
|
|
2775
2774
|
}
|