Could you please check the following METAR:
EGLL 231250Z 14012G22KT 2000 +TSRA FG BKN008 SCT025CB OVC050 18/17 Q1010 TEMPO 1000 -SHRA RMK QFE998
In my case, the RMK QFE998 section is not being parsed correctly.
I tried to resolve this issue by adding a condition to break the loop before the RMK section, and it fixed the problem. Here’s the updated code:
parseTrend(index: number, trend: IMetarTrend, trendParts: string[]): number {
let i = index + 1;
while (
i < trendParts.length &&
trendParts[i] !== this.TEMPO &&
trendParts[i] !== this.INTER &&
trendParts[i] !== this.BECMG &&
trendParts[i] !== this.RMK // <-- this added
) {...}
...
return i - 1;
}