metar-taf-parser 9.1.0 → 9.1.2

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 (2) hide show
  1. package/metar-taf-parser.js +13 -6
  2. package/package.json +16 -16
@@ -14,7 +14,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
14
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
15
  PERFORMANCE OF THIS SOFTWARE.
16
16
  ***************************************************************************** */
17
- /* global Reflect, Promise, SuppressedError, Symbol */
17
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
18
18
 
19
19
 
20
20
  function __classPrivateFieldGet(receiver, state, kind, f) {
@@ -2150,7 +2150,7 @@ var _RunwayCommand_genericRegex, _RunwayCommand_runwayMaxRangeRegex, _RunwayComm
2150
2150
  class RunwayCommand {
2151
2151
  constructor() {
2152
2152
  _RunwayCommand_genericRegex.set(this, /^(R\d{2}\w?\/)/);
2153
- _RunwayCommand_runwayMaxRangeRegex.set(this, /^R(\d{2}\w?)\/(\d{4})V(\d{3,4})([UDN])?(FT)?/);
2153
+ _RunwayCommand_runwayMaxRangeRegex.set(this, /^R(\d{2}\w?)\/(\d{4})V([MP])?(\d{3,4})(?:([UDN])|(FT)(?:\/([UDN]))?)$/);
2154
2154
  _RunwayCommand_runwayRegex.set(this, /^R(\d{2}\w?)\/([MP])?(\d{4})(?:([UDN])|(FT)(?:\/([UDN]))?)$/);
2155
2155
  _RunwayCommand_runwayDepositRegex.set(this, /^R(\d{2}\w?)\/([/\d])([/\d])(\/\/|\d{2})(\/\/|\d{2})$/);
2156
2156
  }
@@ -2198,14 +2198,21 @@ class RunwayCommand {
2198
2198
  const matches = input.match(__classPrivateFieldGet(this, _RunwayCommand_runwayMaxRangeRegex, "f"));
2199
2199
  if (!matches)
2200
2200
  throw new UnexpectedParseError("Should be able to parse");
2201
- const trend = matches[4] ? as(matches[4], RunwayInfoTrend) : undefined;
2202
- const unit = matches[5]
2203
- ? as(matches[5], RunwayInfoUnit)
2201
+ const indicator = matches[3] ? as(matches[3], ValueIndicator) : undefined;
2202
+ const trend = (() => {
2203
+ if (matches[7])
2204
+ return as(matches[7], RunwayInfoTrend);
2205
+ if (matches[5])
2206
+ return as(matches[5], RunwayInfoTrend);
2207
+ })();
2208
+ const unit = matches[6]
2209
+ ? as(matches[6], RunwayInfoUnit)
2204
2210
  : RunwayInfoUnit.Meters;
2205
2211
  metar.runwaysInfo.push({
2206
2212
  name: matches[1],
2213
+ indicator,
2207
2214
  minRange: +matches[2],
2208
- maxRange: +matches[3],
2215
+ maxRange: +matches[4],
2209
2216
  trend,
2210
2217
  unit,
2211
2218
  });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "metar-taf-parser",
3
- "version": "9.1.0",
3
+ "version": "9.1.2",
4
4
  "description": "Parse METAR and TAF reports",
5
5
  "homepage": "https://aeharding.github.io/metar-taf-parser",
6
- "packageManager": "pnpm@9.0.6+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3",
6
+ "packageManager": "pnpm@10.1.0+sha512.c89847b0667ddab50396bbbd008a2a43cf3b581efd59cf5d9aa8923ea1fb4b8106c041d540d08acb095037594d73ebc51e1ec89ee40c88b30b8a66c0fae0ac1b",
7
7
  "keywords": [
8
8
  "aviation",
9
9
  "weather",
@@ -39,23 +39,23 @@
39
39
  "metar-taf-parser.*"
40
40
  ],
41
41
  "devDependencies": {
42
- "@babel/preset-env": "^7.24.5",
43
- "@babel/preset-typescript": "^7.24.1",
44
- "@rollup/plugin-typescript": "^11.1.6",
45
- "@types/jest": "^29.5.12",
46
- "@types/lodash": "^4.17.1",
47
- "@types/node": "^20.12.8",
42
+ "@babel/preset-env": "^7.26.0",
43
+ "@babel/preset-typescript": "^7.26.0",
44
+ "@rollup/plugin-typescript": "^12.1.2",
45
+ "@types/jest": "^29.5.14",
46
+ "@types/lodash": "^4.17.14",
47
+ "@types/node": "^22.10.5",
48
48
  "jest": "^29.7.0",
49
49
  "lodash": "^4.17.21",
50
- "prettier": "^3.2.5",
51
- "rimraf": "^5.0.5",
52
- "rollup": "^4.17.2",
53
- "rollup-plugin-dts": "^6.1.0",
54
- "ts-jest": "^29.1.2",
50
+ "prettier": "^3.4.2",
51
+ "rimraf": "^6.0.1",
52
+ "rollup": "^4.29.2",
53
+ "rollup-plugin-dts": "^6.1.1",
54
+ "ts-jest": "^29.2.5",
55
55
  "ts-node": "^10.9.2",
56
- "tsc-alias": "^1.8.8",
57
- "tslib": "^2.6.2",
58
- "typescript": "^5.4.5",
56
+ "tsc-alias": "^1.8.10",
57
+ "tslib": "^2.8.1",
58
+ "typescript": "^5.7.2",
59
59
  "watch": "^1.0.2"
60
60
  }
61
61
  }