metar-taf-parser 0.0.1 → 0.0.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 (57) hide show
  1. package/README.md +8 -2
  2. package/dist/{lib/command → command}/common.d.ts +1 -1
  3. package/dist/{lib/command → command}/common.js +4 -4
  4. package/dist/{lib/command → command}/metar.d.ts +5 -1
  5. package/dist/{lib/command → command}/metar.js +6 -5
  6. package/dist/{lib/command → command}/remark.d.ts +5 -1
  7. package/dist/{lib/command → command}/remark.js +130 -148
  8. package/dist/{lib/commons → commons}/converter.d.ts +0 -0
  9. package/dist/{lib/commons → commons}/converter.js +2 -2
  10. package/dist/{lib/commons → commons}/errors.d.ts +7 -2
  11. package/dist/{lib/commons → commons}/errors.js +8 -3
  12. package/dist/commons/i18n.d.ts +12 -0
  13. package/dist/{lib/commons → commons}/i18n.js +12 -4
  14. package/dist/{lib/helpers → helpers}/helpers.d.ts +0 -1
  15. package/dist/helpers/helpers.js +23 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.js +38 -0
  18. package/dist/locale/de.d.ts +321 -0
  19. package/dist/locale/de.js +322 -0
  20. package/dist/locale/en.d.ts +387 -0
  21. package/dist/locale/en.js +398 -0
  22. package/dist/locale/fr.d.ts +365 -0
  23. package/dist/locale/fr.js +376 -0
  24. package/dist/locale/it.d.ts +337 -0
  25. package/dist/locale/it.js +338 -0
  26. package/dist/locale/pl.d.ts +98 -0
  27. package/dist/locale/pl.js +99 -0
  28. package/dist/locale/zh-CN.d.ts +111 -0
  29. package/dist/locale/zh-CN.js +112 -0
  30. package/dist/model/enum.d.ts +221 -0
  31. package/dist/model/enum.js +231 -0
  32. package/dist/{lib/model → model}/model.d.ts +14 -7
  33. package/dist/{lib/model → model}/model.js +1 -1
  34. package/dist/parser/parser.d.ts +66 -0
  35. package/dist/parser/parser.js +322 -0
  36. package/package.json +8 -3
  37. package/dist/lib/commons/i18n.d.ts +0 -3
  38. package/dist/lib/helpers/helpers.js +0 -28
  39. package/dist/lib/index.d.ts +0 -1
  40. package/dist/lib/index.js +0 -3
  41. package/dist/lib/locale/en.json +0 -396
  42. package/dist/lib/model/enum.d.ts +0 -122
  43. package/dist/lib/model/enum.js +0 -132
  44. package/dist/lib/parser/parser.d.ts +0 -26
  45. package/dist/lib/parser/parser.js +0 -198
  46. package/dist/tests/command/common.test.d.ts +0 -1
  47. package/dist/tests/command/common.test.js +0 -102
  48. package/dist/tests/command/metar.test.d.ts +0 -1
  49. package/dist/tests/command/metar.test.js +0 -52
  50. package/dist/tests/command/remark.test.d.ts +0 -1
  51. package/dist/tests/command/remark.test.js +0 -689
  52. package/dist/tests/common/converter.test.d.ts +0 -1
  53. package/dist/tests/common/converter.test.js +0 -78
  54. package/dist/tests/helpers/helpers.test.d.ts +0 -1
  55. package/dist/tests/helpers/helpers.test.js +0 -17
  56. package/dist/tests/parser/parser.test.d.ts +0 -1
  57. package/dist/tests/parser/parser.test.js +0 -96
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
26
3
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
27
4
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -30,11 +7,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
30
7
  var _CeilingHeightCommand_regex, _CeilingSecondLocationCommand_regex, _HailSizeCommand_regex, _HourlyMaximumMinimumTemperatureCommand_regex, _HourlyMaximumTemperatureCommand_regex, _HourlyMinimumTemperatureCommand_regex, _HourlyPrecipitationAmountCommand_regex, _HourlyPressureCommand_regex, _HourlyTemperatureDewPointCommand_regex, _IceAccretionCommand_regex, _ObscurationCommand_regex, _PrecipitationAmount24HourCommand_regex, _PrecipitationAmount36HourCommand_regex, _PrecipitationBegEndCommand_regex, _PrevailingVisibilityCommand_regex, _SeaLevelPressureCommand_regex, _SecondLocationVisibilityCommand_regex, _SectorVisibilityCommand_regex, _SmallHailSizeCommand_regex, _SnowDepthCommand_regex, _SnowIncreaseCommand_regex, _SnowPelletsCommand_regex, _SunshineDurationCommand_regex, _SurfaceVisibilityCommand_regex, _ThunderStormLocationCommand_regex, _ThunderStormLocationMovingCommand_regex, _TornadicActivityBegCommand_regex, _TornadicActivityBegEndCommand_regex, _TornadicActivityEndCommand_regex, _TowerVisibilityCommand_regex, _VariableSkyCommand_regex, _VariableSkyHeightCommand_regex, _VirgaDirectionCommand_regex, _WaterEquivalentSnowCommand_regex, _WindPeakCommand_regex, _WindShiftCommand_regex, _WindShiftFropaCommand_regex;
31
8
  Object.defineProperty(exports, "__esModule", { value: true });
32
9
  exports.RemarkCommandSupplier = exports.DefaultCommand = exports.WindShiftFropaCommand = exports.WindShiftCommand = exports.WindPeakCommand = exports.WaterEquivalentSnowCommand = exports.VirgaDirectionCommand = exports.VariableSkyHeightCommand = exports.VariableSkyCommand = exports.TowerVisibilityCommand = exports.TornadicActivityEndCommand = exports.TornadicActivityBegEndCommand = exports.TornadicActivityBegCommand = exports.ThunderStormLocationMovingCommand = exports.ThunderStormLocationCommand = exports.SurfaceVisibilityCommand = exports.SunshineDurationCommand = exports.SnowPelletsCommand = exports.SnowIncreaseCommand = exports.SnowDepthCommand = exports.SmallHailSizeCommand = exports.SectorVisibilityCommand = exports.SecondLocationVisibilityCommand = exports.SeaLevelPressureCommand = exports.PrevailingVisibilityCommand = exports.PrecipitationBegEndCommand = exports.PrecipitationAmount36HourCommand = exports.PrecipitationAmount24HourCommand = exports.ObscurationCommand = exports.IceAccretionCommand = exports.HourlyTemperatureDewPointCommand = exports.HourlyPressureCommand = exports.HourlyPrecipitationAmountCommand = exports.HourlyMinimumTemperatureCommand = exports.HourlyMaximumTemperatureCommand = exports.HourlyMaximumMinimumTemperatureCommand = exports.HailSizeCommand = exports.CeilingSecondLocationCommand = exports.CeilingHeightCommand = exports.Command = void 0;
33
- const helpers_1 = require("helpers/helpers");
34
- const converter_1 = require("commons/converter");
35
- const i18n_1 = __importStar(require("commons/i18n"));
36
- const errors_1 = require("commons/errors");
10
+ const helpers_1 = require("../helpers/helpers");
11
+ const converter_1 = require("../commons/converter");
12
+ const i18n_1 = require("../commons/i18n");
13
+ const errors_1 = require("../commons/errors");
37
14
  class Command {
15
+ constructor(locale) {
16
+ this.locale = locale;
17
+ }
38
18
  }
39
19
  exports.Command = Command;
40
20
  class CeilingHeightCommand extends Command {
@@ -51,8 +31,8 @@ class CeilingHeightCommand extends Command {
51
31
  throw new errors_1.UnexpectedParseError("Match not found");
52
32
  const minCeiling = +matches[1] * 100;
53
33
  const maxCeiling = +matches[2] * 100;
54
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Ceiling.Height, minCeiling, maxCeiling));
55
- return [code.replace(__classPrivateFieldGet(this, _CeilingHeightCommand_regex, "f"), ""), remark];
34
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Ceiling.Height", this.locale), minCeiling, maxCeiling));
35
+ return [code.replace(__classPrivateFieldGet(this, _CeilingHeightCommand_regex, "f"), "").trim(), remark];
56
36
  }
57
37
  }
58
38
  exports.CeilingHeightCommand = CeilingHeightCommand;
@@ -70,8 +50,8 @@ class CeilingSecondLocationCommand extends Command {
70
50
  if (!matches)
71
51
  throw new errors_1.UnexpectedParseError("Match not found");
72
52
  const height = +matches[1] * 100;
73
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Ceiling.Second.Location, height, matches[2]));
74
- return [code.replace(__classPrivateFieldGet(this, _CeilingSecondLocationCommand_regex, "f"), ""), remark];
53
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Ceiling.Second.Location", this.locale), height, matches[2]));
54
+ return [code.replace(__classPrivateFieldGet(this, _CeilingSecondLocationCommand_regex, "f"), "").trim(), remark];
75
55
  }
76
56
  }
77
57
  exports.CeilingSecondLocationCommand = CeilingSecondLocationCommand;
@@ -88,8 +68,8 @@ class HailSizeCommand extends Command {
88
68
  const matches = code.match(__classPrivateFieldGet(this, _HailSizeCommand_regex, "f"));
89
69
  if (!matches)
90
70
  throw new errors_1.UnexpectedParseError("Match not found");
91
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hail[0], matches[1]));
92
- return [code.replace(__classPrivateFieldGet(this, _HailSizeCommand_regex, "f"), ""), remark];
71
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hail.0", this.locale), matches[1]));
72
+ return [code.replace(__classPrivateFieldGet(this, _HailSizeCommand_regex, "f"), "").trim(), remark];
93
73
  }
94
74
  }
95
75
  exports.HailSizeCommand = HailSizeCommand;
@@ -106,8 +86,8 @@ class HourlyMaximumMinimumTemperatureCommand extends Command {
106
86
  const matches = code.match(__classPrivateFieldGet(this, _HourlyMaximumMinimumTemperatureCommand_regex, "f"));
107
87
  if (!matches)
108
88
  throw new errors_1.UnexpectedParseError("Match not found");
109
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hourly.Maximum.Minimum.Temperature, (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2]), (0, converter_1.convertTemperatureRemarks)(matches[3], matches[4])));
110
- return [code.replace(__classPrivateFieldGet(this, _HourlyMaximumMinimumTemperatureCommand_regex, "f"), ""), remark];
89
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hourly.Maximum.Minimum.Temperature", this.locale), (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2]), (0, converter_1.convertTemperatureRemarks)(matches[3], matches[4])));
90
+ return [code.replace(__classPrivateFieldGet(this, _HourlyMaximumMinimumTemperatureCommand_regex, "f"), "").trim(), remark];
111
91
  }
112
92
  }
113
93
  exports.HourlyMaximumMinimumTemperatureCommand = HourlyMaximumMinimumTemperatureCommand;
@@ -124,8 +104,8 @@ class HourlyMaximumTemperatureCommand extends Command {
124
104
  const matches = code.match(__classPrivateFieldGet(this, _HourlyMaximumTemperatureCommand_regex, "f"));
125
105
  if (!matches)
126
106
  throw new errors_1.UnexpectedParseError("Match not found");
127
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hourly.Maximum.Temperature, (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
128
- return [code.replace(__classPrivateFieldGet(this, _HourlyMaximumTemperatureCommand_regex, "f"), ""), remark];
107
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hourly.Maximum.Temperature", this.locale), (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
108
+ return [code.replace(__classPrivateFieldGet(this, _HourlyMaximumTemperatureCommand_regex, "f"), "").trim(), remark];
129
109
  }
130
110
  }
131
111
  exports.HourlyMaximumTemperatureCommand = HourlyMaximumTemperatureCommand;
@@ -142,8 +122,8 @@ class HourlyMinimumTemperatureCommand extends Command {
142
122
  const matches = code.match(__classPrivateFieldGet(this, _HourlyMinimumTemperatureCommand_regex, "f"));
143
123
  if (!matches)
144
124
  throw new errors_1.UnexpectedParseError("Match not found");
145
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hourly.Minimum.Temperature, (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
146
- return [code.replace(__classPrivateFieldGet(this, _HourlyMinimumTemperatureCommand_regex, "f"), ""), remark];
125
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hourly.Minimum.Temperature", this.locale), (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
126
+ return [code.replace(__classPrivateFieldGet(this, _HourlyMinimumTemperatureCommand_regex, "f"), "").trim(), remark];
147
127
  }
148
128
  }
149
129
  exports.HourlyMinimumTemperatureCommand = HourlyMinimumTemperatureCommand;
@@ -160,8 +140,8 @@ class HourlyPrecipitationAmountCommand extends Command {
160
140
  const matches = code.match(__classPrivateFieldGet(this, _HourlyPrecipitationAmountCommand_regex, "f"));
161
141
  if (!matches)
162
142
  throw new errors_1.UnexpectedParseError("Match not found");
163
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Precipitation.Amount.Hourly, +matches[1]));
164
- return [code.replace(__classPrivateFieldGet(this, _HourlyPrecipitationAmountCommand_regex, "f"), ""), remark];
143
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Amount.Hourly", this.locale), +matches[1]));
144
+ return [code.replace(__classPrivateFieldGet(this, _HourlyPrecipitationAmountCommand_regex, "f"), "").trim(), remark];
165
145
  }
166
146
  }
167
147
  exports.HourlyPrecipitationAmountCommand = HourlyPrecipitationAmountCommand;
@@ -178,8 +158,8 @@ class HourlyPressureCommand extends Command {
178
158
  const matches = code.match(__classPrivateFieldGet(this, _HourlyPressureCommand_regex, "f"));
179
159
  if (!matches)
180
160
  throw new errors_1.UnexpectedParseError("Match not found");
181
- remark.push(`${i18n_1.default.Remark.Barometer[+matches[1]]} ${(0, i18n_1.format)(i18n_1.default.Remark.Pressure.Tendency, +matches[1])}`);
182
- return [code.replace(__classPrivateFieldGet(this, _HourlyPressureCommand_regex, "f"), ""), remark];
161
+ remark.push(`${(0, i18n_1._)(`Remark.Barometer.${+matches[1]}`, this.locale)} ${(0, i18n_1.format)((0, i18n_1._)("Remark.Pressure.Tendency", this.locale), +matches[1])}`);
162
+ return [code.replace(__classPrivateFieldGet(this, _HourlyPressureCommand_regex, "f"), "").trim(), remark];
183
163
  }
184
164
  }
185
165
  exports.HourlyPressureCommand = HourlyPressureCommand;
@@ -197,12 +177,12 @@ class HourlyTemperatureDewPointCommand extends Command {
197
177
  if (!matches)
198
178
  throw new errors_1.UnexpectedParseError("Match not found");
199
179
  if (!matches[3]) {
200
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hourly.Temperature[0], (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
180
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hourly.Temperature.0", this.locale), (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2])));
201
181
  }
202
182
  else {
203
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hourly.Temperature.Dew.Point, (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2]), (0, converter_1.convertTemperatureRemarks)(matches[4], matches[5])));
183
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hourly.Temperature.Dew.Point", this.locale), (0, converter_1.convertTemperatureRemarks)(matches[1], matches[2]), (0, converter_1.convertTemperatureRemarks)(matches[4], matches[5])));
204
184
  }
205
- return [code.replace(__classPrivateFieldGet(this, _HourlyTemperatureDewPointCommand_regex, "f"), ""), remark];
185
+ return [code.replace(__classPrivateFieldGet(this, _HourlyTemperatureDewPointCommand_regex, "f"), "").trim(), remark];
206
186
  }
207
187
  }
208
188
  exports.HourlyTemperatureDewPointCommand = HourlyTemperatureDewPointCommand;
@@ -219,8 +199,8 @@ class IceAccretionCommand extends Command {
219
199
  const matches = code.match(__classPrivateFieldGet(this, _IceAccretionCommand_regex, "f"));
220
200
  if (!matches)
221
201
  throw new errors_1.UnexpectedParseError("Match not found");
222
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Ice.Accretion.Amount, +matches[2], +matches[1]));
223
- return [code.replace(__classPrivateFieldGet(this, _IceAccretionCommand_regex, "f"), ""), remark];
202
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Ice.Accretion.Amount", this.locale), +matches[2], +matches[1]));
203
+ return [code.replace(__classPrivateFieldGet(this, _IceAccretionCommand_regex, "f"), "").trim(), remark];
224
204
  }
225
205
  }
226
206
  exports.IceAccretionCommand = IceAccretionCommand;
@@ -237,11 +217,11 @@ class ObscurationCommand extends Command {
237
217
  const matches = code.match(__classPrivateFieldGet(this, _ObscurationCommand_regex, "f"));
238
218
  if (!matches)
239
219
  throw new errors_1.UnexpectedParseError("Match not found");
240
- const layer = i18n_1.default.CloudQuantity[matches[2]];
220
+ const layer = (0, i18n_1._)(`CloudQuantity.${matches[2]}`, this.locale);
241
221
  const height = 100 * +matches[3];
242
- const detail = i18n_1.default.Phenomenon[matches[1]];
243
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Obscuration, layer, height, detail));
244
- return [code.replace(__classPrivateFieldGet(this, _ObscurationCommand_regex, "f"), ""), remark];
222
+ const detail = (0, i18n_1._)(`Phenomenon.${matches[1]}`, this.locale);
223
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Obscuration", this.locale), layer, height, detail));
224
+ return [code.replace(__classPrivateFieldGet(this, _ObscurationCommand_regex, "f"), "").trim(), remark];
245
225
  }
246
226
  }
247
227
  exports.ObscurationCommand = ObscurationCommand;
@@ -258,8 +238,8 @@ class PrecipitationAmount24HourCommand extends Command {
258
238
  const matches = code.match(__classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f"));
259
239
  if (!matches)
260
240
  throw new errors_1.UnexpectedParseError("Match not found");
261
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Precipitation.Amount[24], (0, converter_1.convertPrecipitationAmount)(matches[1])));
262
- return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f"), ""), remark];
241
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Amount.24", this.locale), (0, converter_1.convertPrecipitationAmount)(matches[1])));
242
+ return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f"), "").trim(), remark];
263
243
  }
264
244
  }
265
245
  exports.PrecipitationAmount24HourCommand = PrecipitationAmount24HourCommand;
@@ -276,8 +256,8 @@ class PrecipitationAmount36HourCommand extends Command {
276
256
  const matches = code.match(__classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f"));
277
257
  if (!matches)
278
258
  throw new errors_1.UnexpectedParseError("Match not found");
279
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Precipitation.Amount[3][6], matches[1], (0, converter_1.convertPrecipitationAmount)(matches[2])));
280
- return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f"), ""), remark];
259
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Amount.3.6", this.locale), matches[1], (0, converter_1.convertPrecipitationAmount)(matches[2])));
260
+ return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f"), "").trim(), remark];
281
261
  }
282
262
  }
283
263
  exports.PrecipitationAmount36HourCommand = PrecipitationAmount36HourCommand;
@@ -294,10 +274,8 @@ class PrecipitationBegEndCommand extends Command {
294
274
  const matches = code.match(__classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f"));
295
275
  if (!matches)
296
276
  throw new errors_1.UnexpectedParseError("Match not found");
297
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Precipitation.Beg.End, matches[2]
298
- ? i18n_1.default.Descriptive[matches[2]]
299
- : "", i18n_1.default.Phenomenon[matches[3]], matches[4] || "", matches[5], matches[6] || "", matches[7]));
300
- return [code.replace(__classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f"), ""), remark];
277
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Beg.End", this.locale), matches[2] ? (0, i18n_1._)(`Descriptive.${matches[2]}`, this.locale) : "", (0, i18n_1._)(`Phenomenon.${matches[3]}`, this.locale), matches[4] || "", matches[5], matches[6] || "", matches[7]));
278
+ return [code.replace(__classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f"), "").trim(), remark];
301
279
  }
302
280
  }
303
281
  exports.PrecipitationBegEndCommand = PrecipitationBegEndCommand;
@@ -314,8 +292,8 @@ class PrevailingVisibilityCommand extends Command {
314
292
  const matches = code.match(__classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f"));
315
293
  if (!matches)
316
294
  throw new errors_1.UnexpectedParseError("Match not found");
317
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Variable.Prevailing.Visibility, matches[1], matches[5]));
318
- return [code.replace(__classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f"), ""), remark];
295
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Variable.Prevailing.Visibility", this.locale), matches[1], matches[5]));
296
+ return [code.replace(__classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f"), "").trim(), remark];
319
297
  }
320
298
  }
321
299
  exports.PrevailingVisibilityCommand = PrevailingVisibilityCommand;
@@ -334,8 +312,8 @@ class SeaLevelPressureCommand extends Command {
334
312
  throw new errors_1.UnexpectedParseError("Match not found");
335
313
  let pressure = matches[1].startsWith("9") ? "9" : "10";
336
314
  pressure += matches[1] + "." + matches[2];
337
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Sea.Level.Pressure, pressure));
338
- return [code.replace(__classPrivateFieldGet(this, _SeaLevelPressureCommand_regex, "f"), ""), remark];
315
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Sea.Level.Pressure", this.locale), pressure));
316
+ return [code.replace(__classPrivateFieldGet(this, _SeaLevelPressureCommand_regex, "f"), "").trim(), remark];
339
317
  }
340
318
  }
341
319
  exports.SeaLevelPressureCommand = SeaLevelPressureCommand;
@@ -352,8 +330,8 @@ class SecondLocationVisibilityCommand extends Command {
352
330
  const matches = code.match(__classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f"));
353
331
  if (!matches)
354
332
  throw new errors_1.UnexpectedParseError("Match not found");
355
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Second.Location.Visibility, matches[1], matches[5]));
356
- return [code.replace(__classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f"), ""), remark];
333
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Second.Location.Visibility", this.locale), matches[1], matches[5]));
334
+ return [code.replace(__classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f"), "").trim(), remark];
357
335
  }
358
336
  }
359
337
  exports.SecondLocationVisibilityCommand = SecondLocationVisibilityCommand;
@@ -370,8 +348,8 @@ class SectorVisibilityCommand extends Command {
370
348
  const matches = code.match(__classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f"));
371
349
  if (!matches)
372
350
  throw new errors_1.UnexpectedParseError("Match not found");
373
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Sector.Visibility, i18n_1.default.Converter[matches[1]], matches[2]));
374
- return [code.replace(__classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f"), ""), remark];
351
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Sector.Visibility", this.locale), (0, i18n_1._)(`Converter.${matches[1]}`, this.locale), matches[2]));
352
+ return [code.replace(__classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f"), "").trim(), remark];
375
353
  }
376
354
  }
377
355
  exports.SectorVisibilityCommand = SectorVisibilityCommand;
@@ -388,8 +366,8 @@ class SmallHailSizeCommand extends Command {
388
366
  const matches = code.match(__classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f"));
389
367
  if (!matches)
390
368
  throw new errors_1.UnexpectedParseError("Match not found");
391
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Hail.LesserThan, matches[1]));
392
- return [code.replace(__classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f"), ""), remark];
369
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Hail.LesserThan", this.locale), matches[1]));
370
+ return [code.replace(__classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f"), "").trim(), remark];
393
371
  }
394
372
  }
395
373
  exports.SmallHailSizeCommand = SmallHailSizeCommand;
@@ -406,8 +384,8 @@ class SnowDepthCommand extends Command {
406
384
  const matches = code.match(__classPrivateFieldGet(this, _SnowDepthCommand_regex, "f"));
407
385
  if (!matches)
408
386
  throw new errors_1.UnexpectedParseError("Match not found");
409
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Snow.Depth, +matches[1]));
410
- return [code.replace(__classPrivateFieldGet(this, _SnowDepthCommand_regex, "f"), ""), remark];
387
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Depth", this.locale), +matches[1]));
388
+ return [code.replace(__classPrivateFieldGet(this, _SnowDepthCommand_regex, "f"), "").trim(), remark];
411
389
  }
412
390
  }
413
391
  exports.SnowDepthCommand = SnowDepthCommand;
@@ -424,8 +402,8 @@ class SnowIncreaseCommand extends Command {
424
402
  const matches = code.match(__classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f"));
425
403
  if (!matches)
426
404
  throw new errors_1.UnexpectedParseError("Match not found");
427
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Snow.Increasing.Rapidly, matches[1], matches[2]));
428
- return [code.replace(__classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f"), ""), remark];
405
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Increasing.Rapidly", this.locale), matches[1], matches[2]));
406
+ return [code.replace(__classPrivateFieldGet(this, _SnowIncreaseCommand_regex, "f"), "").trim(), remark];
429
407
  }
430
408
  }
431
409
  exports.SnowIncreaseCommand = SnowIncreaseCommand;
@@ -442,8 +420,8 @@ class SnowPelletsCommand extends Command {
442
420
  const matches = code.match(__classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f"));
443
421
  if (!matches)
444
422
  throw new errors_1.UnexpectedParseError("Match not found");
445
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Snow.Pellets, i18n_1.default.Remark[matches[1]]));
446
- return [code.replace(__classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f"), ""), remark];
423
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Snow.Pellets", this.locale), (0, i18n_1._)(`Remark.${matches[1]}`, this.locale)));
424
+ return [code.replace(__classPrivateFieldGet(this, _SnowPelletsCommand_regex, "f"), "").trim(), remark];
447
425
  }
448
426
  }
449
427
  exports.SnowPelletsCommand = SnowPelletsCommand;
@@ -460,8 +438,8 @@ class SunshineDurationCommand extends Command {
460
438
  const matches = code.match(__classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f"));
461
439
  if (!matches)
462
440
  throw new errors_1.UnexpectedParseError("Match not found");
463
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Sunshine.Duration, +matches[1]));
464
- return [code.replace(__classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f"), ""), remark];
441
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Sunshine.Duration", this.locale), +matches[1]));
442
+ return [code.replace(__classPrivateFieldGet(this, _SunshineDurationCommand_regex, "f"), "").trim(), remark];
465
443
  }
466
444
  }
467
445
  exports.SunshineDurationCommand = SunshineDurationCommand;
@@ -478,8 +456,8 @@ class SurfaceVisibilityCommand extends Command {
478
456
  const matches = code.match(__classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f"));
479
457
  if (!matches)
480
458
  throw new errors_1.UnexpectedParseError("Match not found");
481
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Surface.Visibility, matches[1]));
482
- return [code.replace(__classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f"), ""), remark];
459
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Surface.Visibility", this.locale), matches[1]));
460
+ return [code.replace(__classPrivateFieldGet(this, _SurfaceVisibilityCommand_regex, "f"), "").trim(), remark];
483
461
  }
484
462
  }
485
463
  exports.SurfaceVisibilityCommand = SurfaceVisibilityCommand;
@@ -496,8 +474,8 @@ class ThunderStormLocationCommand extends Command {
496
474
  const matches = code.match(__classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f"));
497
475
  if (!matches)
498
476
  throw new errors_1.UnexpectedParseError("Match not found");
499
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Thunderstorm.Location[0], i18n_1.default.Converter[matches[1]]));
500
- return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f"), ""), remark];
477
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Thunderstorm.Location.0", this.locale), (0, i18n_1._)(`Converter.${matches[1]}`, this.locale)));
478
+ return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationCommand_regex, "f"), "").trim(), remark];
501
479
  }
502
480
  }
503
481
  exports.ThunderStormLocationCommand = ThunderStormLocationCommand;
@@ -514,8 +492,8 @@ class ThunderStormLocationMovingCommand extends Command {
514
492
  const matches = code.match(__classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f"));
515
493
  if (!matches)
516
494
  throw new errors_1.UnexpectedParseError("Match not found");
517
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Thunderstorm.Location.Moving, i18n_1.default.Converter[matches[1]], i18n_1.default.Converter[matches[2]]));
518
- return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f"), ""), remark];
495
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Thunderstorm.Location.Moving", this.locale), (0, i18n_1._)(`Converter.${matches[1]}`, this.locale), (0, i18n_1._)(`Converter.${matches[2]}`, this.locale)));
496
+ return [code.replace(__classPrivateFieldGet(this, _ThunderStormLocationMovingCommand_regex, "f"), "").trim(), remark];
519
497
  }
520
498
  }
521
499
  exports.ThunderStormLocationMovingCommand = ThunderStormLocationMovingCommand;
@@ -532,8 +510,8 @@ class TornadicActivityBegCommand extends Command {
532
510
  const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f"));
533
511
  if (!matches)
534
512
  throw new errors_1.UnexpectedParseError("Match not found");
535
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Tornadic.Activity.Beginning, i18n_1.default.Remark[matches[1].replace(" ", "")], matches[3] || "", matches[4], matches[6], i18n_1.default.Converter[matches[7]]));
536
- return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f"), ""), remark];
513
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.Beginning", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6], (0, i18n_1._)(`Converter.${matches[7]}`, this.locale)));
514
+ return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegCommand_regex, "f"), "").trim(), remark];
537
515
  }
538
516
  }
539
517
  exports.TornadicActivityBegCommand = TornadicActivityBegCommand;
@@ -550,8 +528,8 @@ class TornadicActivityBegEndCommand extends Command {
550
528
  const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f"));
551
529
  if (!matches)
552
530
  throw new errors_1.UnexpectedParseError("Match not found");
553
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Tornadic.Activity.BegEnd, i18n_1.default.Remark[matches[1].replace(" ", "")], matches[3] || "", matches[4], matches[6] || "", matches[7], matches[9], i18n_1.default.Converter[matches[10]]));
554
- return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f"), ""), remark];
531
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.BegEnd", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6] || "", matches[7], matches[9], (0, i18n_1._)(`Converter.${matches[10]}`, this.locale)));
532
+ return [code.replace(__classPrivateFieldGet(this, _TornadicActivityBegEndCommand_regex, "f"), "").trim(), remark];
555
533
  }
556
534
  }
557
535
  exports.TornadicActivityBegEndCommand = TornadicActivityBegEndCommand;
@@ -568,8 +546,8 @@ class TornadicActivityEndCommand extends Command {
568
546
  const matches = code.match(__classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f"));
569
547
  if (!matches)
570
548
  throw new errors_1.UnexpectedParseError("Match not found");
571
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Tornadic.Activity.Ending, i18n_1.default.Remark[matches[1].replace(" ", "")], matches[3] || "", matches[4], matches[6], i18n_1.default.Converter[matches[7]]));
572
- return [code.replace(__classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f"), ""), remark];
549
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Tornadic.Activity.Ending", this.locale), (0, i18n_1._)(`Remark.${matches[1].replace(" ", "")}`, this.locale), matches[3] || "", matches[4], matches[6], (0, i18n_1._)(`Converter.${matches[7]}`, this.locale)));
550
+ return [code.replace(__classPrivateFieldGet(this, _TornadicActivityEndCommand_regex, "f"), "").trim(), remark];
573
551
  }
574
552
  }
575
553
  exports.TornadicActivityEndCommand = TornadicActivityEndCommand;
@@ -586,8 +564,8 @@ class TowerVisibilityCommand extends Command {
586
564
  const matches = code.match(__classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f"));
587
565
  if (!matches)
588
566
  throw new errors_1.UnexpectedParseError("Match not found");
589
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Tower.Visibility, matches[1]));
590
- return [code.replace(__classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f"), ""), remark];
567
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Tower.Visibility", this.locale), matches[1]));
568
+ return [code.replace(__classPrivateFieldGet(this, _TowerVisibilityCommand_regex, "f"), "").trim(), remark];
591
569
  }
592
570
  }
593
571
  exports.TowerVisibilityCommand = TowerVisibilityCommand;
@@ -604,8 +582,8 @@ class VariableSkyCommand extends Command {
604
582
  const matches = code.match(__classPrivateFieldGet(this, _VariableSkyCommand_regex, "f"));
605
583
  if (!matches)
606
584
  throw new errors_1.UnexpectedParseError("Match not found");
607
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Variable.Sky.Condition[0], i18n_1.default.CloudQuantity[matches[1]], i18n_1.default.CloudQuantity[matches[2]]));
608
- return [code.replace(__classPrivateFieldGet(this, _VariableSkyCommand_regex, "f"), ""), remark];
585
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Variable.Sky.Condition.0", this.locale), (0, i18n_1._)(`CloudQuantity.${matches[1]}`, this.locale), (0, i18n_1._)(`CloudQuantity.${matches[2]}`, this.locale)));
586
+ return [code.replace(__classPrivateFieldGet(this, _VariableSkyCommand_regex, "f"), "").trim(), remark];
609
587
  }
610
588
  }
611
589
  exports.VariableSkyCommand = VariableSkyCommand;
@@ -622,8 +600,8 @@ class VariableSkyHeightCommand extends Command {
622
600
  const matches = code.match(__classPrivateFieldGet(this, _VariableSkyHeightCommand_regex, "f"));
623
601
  if (!matches)
624
602
  throw new errors_1.UnexpectedParseError("Match not found");
625
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Variable.Sky.Condition.Height, 100 * +matches[2], i18n_1.default.CloudQuantity[matches[1]], i18n_1.default.CloudQuantity[matches[3]]));
626
- return [code.replace(__classPrivateFieldGet(this, _VariableSkyHeightCommand_regex, "f"), ""), remark];
603
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Variable.Sky.Condition.Height", this.locale), 100 * +matches[2], (0, i18n_1._)(`CloudQuantity.${matches[1]}`, this.locale), (0, i18n_1._)(`CloudQuantity.${matches[3]}`, this.locale)));
604
+ return [code.replace(__classPrivateFieldGet(this, _VariableSkyHeightCommand_regex, "f"), "").trim(), remark];
627
605
  }
628
606
  }
629
607
  exports.VariableSkyHeightCommand = VariableSkyHeightCommand;
@@ -640,8 +618,8 @@ class VirgaDirectionCommand extends Command {
640
618
  const matches = code.match(__classPrivateFieldGet(this, _VirgaDirectionCommand_regex, "f"));
641
619
  if (!matches)
642
620
  throw new errors_1.UnexpectedParseError("Match not found");
643
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Virga.Direction, i18n_1.default.Converter[matches[1]]));
644
- return [code.replace(__classPrivateFieldGet(this, _VirgaDirectionCommand_regex, "f"), ""), remark];
621
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Virga.Direction", this.locale), (0, i18n_1._)(`Converter.${matches[1]}`, this.locale)));
622
+ return [code.replace(__classPrivateFieldGet(this, _VirgaDirectionCommand_regex, "f"), "").trim(), remark];
645
623
  }
646
624
  }
647
625
  exports.VirgaDirectionCommand = VirgaDirectionCommand;
@@ -658,8 +636,8 @@ class WaterEquivalentSnowCommand extends Command {
658
636
  const matches = code.match(__classPrivateFieldGet(this, _WaterEquivalentSnowCommand_regex, "f"));
659
637
  if (!matches)
660
638
  throw new errors_1.UnexpectedParseError("Match not found");
661
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.Water.Equivalent.Snow.Ground, +matches[1] / 10));
662
- return [code.replace(__classPrivateFieldGet(this, _WaterEquivalentSnowCommand_regex, "f"), ""), remark];
639
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.Water.Equivalent.Snow.Ground", this.locale), +matches[1] / 10));
640
+ return [code.replace(__classPrivateFieldGet(this, _WaterEquivalentSnowCommand_regex, "f"), "").trim(), remark];
663
641
  }
664
642
  }
665
643
  exports.WaterEquivalentSnowCommand = WaterEquivalentSnowCommand;
@@ -676,8 +654,8 @@ class WindPeakCommand extends Command {
676
654
  const matches = code.match(__classPrivateFieldGet(this, _WindPeakCommand_regex, "f"));
677
655
  if (!matches)
678
656
  throw new errors_1.UnexpectedParseError("Match not found");
679
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.PeakWind, matches[1], matches[2], matches[3] || "", matches[4]));
680
- return [code.replace(__classPrivateFieldGet(this, _WindPeakCommand_regex, "f"), ""), remark];
657
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.PeakWind", this.locale), matches[1], matches[2], matches[3] || "", matches[4]));
658
+ return [code.replace(__classPrivateFieldGet(this, _WindPeakCommand_regex, "f"), "").trim(), remark];
681
659
  }
682
660
  }
683
661
  exports.WindPeakCommand = WindPeakCommand;
@@ -694,8 +672,8 @@ class WindShiftCommand extends Command {
694
672
  const matches = code.match(__classPrivateFieldGet(this, _WindShiftCommand_regex, "f"));
695
673
  if (!matches)
696
674
  throw new errors_1.UnexpectedParseError("Match not found");
697
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.WindShift[0], matches[1] || "", matches[2]));
698
- return [code.replace(__classPrivateFieldGet(this, _WindShiftCommand_regex, "f"), ""), remark];
675
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.WindShift.0", this.locale), matches[1] || "", matches[2]));
676
+ return [code.replace(__classPrivateFieldGet(this, _WindShiftCommand_regex, "f"), "").trim(), remark];
699
677
  }
700
678
  }
701
679
  exports.WindShiftCommand = WindShiftCommand;
@@ -712,8 +690,8 @@ class WindShiftFropaCommand extends Command {
712
690
  const matches = code.match(__classPrivateFieldGet(this, _WindShiftFropaCommand_regex, "f"));
713
691
  if (!matches)
714
692
  throw new errors_1.UnexpectedParseError("Match not found");
715
- remark.push((0, i18n_1.format)(i18n_1.default.Remark.WindShift.FROPA, matches[1] || "", matches[2]));
716
- return [code.replace(__classPrivateFieldGet(this, _WindShiftFropaCommand_regex, "f"), ""), remark];
693
+ remark.push((0, i18n_1.format)((0, i18n_1._)("Remark.WindShift.FROPA", this.locale), matches[1] || "", matches[2]));
694
+ return [code.replace(__classPrivateFieldGet(this, _WindShiftFropaCommand_regex, "f"), "").trim(), remark];
717
695
  }
718
696
  }
719
697
  exports.WindShiftFropaCommand = WindShiftFropaCommand;
@@ -724,10 +702,13 @@ class DefaultCommand extends Command {
724
702
  }
725
703
  execute(code, remark) {
726
704
  const rmkSplit = (0, helpers_1.pySplit)(code, " ", 1);
727
- if (i18n_1.default.Remark[rmkSplit[0]]) {
728
- remark.push(i18n_1.default.Remark[rmkSplit[0]]);
705
+ try {
706
+ const rem = (0, i18n_1._)(`Remark.${rmkSplit[0]}`, this.locale);
707
+ remark.push(rem);
729
708
  }
730
- else {
709
+ catch (error) {
710
+ if (!(error instanceof errors_1.TranslationError))
711
+ throw error;
731
712
  remark.push(rmkSplit[0]);
732
713
  }
733
714
  return [rmkSplit.length === 1 ? "" : rmkSplit[1], remark];
@@ -735,46 +716,47 @@ class DefaultCommand extends Command {
735
716
  }
736
717
  exports.DefaultCommand = DefaultCommand;
737
718
  class RemarkCommandSupplier {
738
- constructor() {
739
- this.defaultCommand = new DefaultCommand();
719
+ constructor(locale) {
720
+ this.locale = locale;
721
+ this.defaultCommand = new DefaultCommand(locale);
740
722
  this.commandList = [
741
- new WindPeakCommand(),
742
- new WindShiftFropaCommand(),
743
- new WindShiftCommand(),
744
- new TowerVisibilityCommand(),
745
- new SurfaceVisibilityCommand(),
746
- new PrevailingVisibilityCommand(),
747
- new SecondLocationVisibilityCommand(),
748
- new SectorVisibilityCommand(),
749
- new TornadicActivityBegEndCommand(),
750
- new TornadicActivityBegCommand(),
751
- new TornadicActivityEndCommand(),
752
- new PrecipitationBegEndCommand(),
753
- new ThunderStormLocationMovingCommand(),
754
- new ThunderStormLocationCommand(),
755
- new SmallHailSizeCommand(),
756
- new HailSizeCommand(),
757
- new SnowPelletsCommand(),
758
- new VirgaDirectionCommand(),
759
- new CeilingHeightCommand(),
760
- new ObscurationCommand(),
761
- new VariableSkyHeightCommand(),
762
- new VariableSkyCommand(),
763
- new CeilingSecondLocationCommand(),
764
- new SeaLevelPressureCommand(),
765
- new SnowIncreaseCommand(),
766
- new HourlyMaximumMinimumTemperatureCommand(),
767
- new HourlyMaximumTemperatureCommand(),
768
- new HourlyMinimumTemperatureCommand(),
769
- new HourlyPrecipitationAmountCommand(),
770
- new HourlyTemperatureDewPointCommand(),
771
- new HourlyPressureCommand(),
772
- new IceAccretionCommand(),
773
- new PrecipitationAmount36HourCommand(),
774
- new PrecipitationAmount24HourCommand(),
775
- new SnowDepthCommand(),
776
- new SunshineDurationCommand(),
777
- new WaterEquivalentSnowCommand(),
723
+ new WindPeakCommand(locale),
724
+ new WindShiftFropaCommand(locale),
725
+ new WindShiftCommand(locale),
726
+ new TowerVisibilityCommand(locale),
727
+ new SurfaceVisibilityCommand(locale),
728
+ new PrevailingVisibilityCommand(locale),
729
+ new SecondLocationVisibilityCommand(locale),
730
+ new SectorVisibilityCommand(locale),
731
+ new TornadicActivityBegEndCommand(locale),
732
+ new TornadicActivityBegCommand(locale),
733
+ new TornadicActivityEndCommand(locale),
734
+ new PrecipitationBegEndCommand(locale),
735
+ new ThunderStormLocationMovingCommand(locale),
736
+ new ThunderStormLocationCommand(locale),
737
+ new SmallHailSizeCommand(locale),
738
+ new HailSizeCommand(locale),
739
+ new SnowPelletsCommand(locale),
740
+ new VirgaDirectionCommand(locale),
741
+ new CeilingHeightCommand(locale),
742
+ new ObscurationCommand(locale),
743
+ new VariableSkyHeightCommand(locale),
744
+ new VariableSkyCommand(locale),
745
+ new CeilingSecondLocationCommand(locale),
746
+ new SeaLevelPressureCommand(locale),
747
+ new SnowIncreaseCommand(locale),
748
+ new HourlyMaximumMinimumTemperatureCommand(locale),
749
+ new HourlyMaximumTemperatureCommand(locale),
750
+ new HourlyMinimumTemperatureCommand(locale),
751
+ new HourlyPrecipitationAmountCommand(locale),
752
+ new HourlyTemperatureDewPointCommand(locale),
753
+ new HourlyPressureCommand(locale),
754
+ new IceAccretionCommand(locale),
755
+ new PrecipitationAmount36HourCommand(locale),
756
+ new PrecipitationAmount24HourCommand(locale),
757
+ new SnowDepthCommand(locale),
758
+ new SunshineDurationCommand(locale),
759
+ new WaterEquivalentSnowCommand(locale),
778
760
  ];
779
761
  }
780
762
  get(code) {
File without changes
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertPrecipitationAmount = exports.convertTemperatureRemarks = exports.convertInchesMercuryToPascal = exports.convertTemperature = exports.convertVisibility = exports.degreesToCardinal = void 0;
4
- const helpers_1 = require("helpers/helpers");
4
+ const helpers_1 = require("../helpers/helpers");
5
5
  function degreesToCardinal(input) {
6
6
  const degrees = +input;
7
7
  if (isNaN(degrees))
@@ -31,7 +31,7 @@ exports.degreesToCardinal = degreesToCardinal;
31
31
  function convertVisibility(input) {
32
32
  if (input === "9999")
33
33
  return "> 10km";
34
- return `${input}m`;
34
+ return `${+input}m`;
35
35
  }
36
36
  exports.convertVisibility = convertVisibility;
37
37
  function convertTemperature(input) {
@@ -1,15 +1,20 @@
1
- export declare class ParseError extends Error {
1
+ export declare abstract class ParseError extends Error {
2
+ name: string;
2
3
  constructor(message?: string);
3
4
  }
4
5
  export declare class InvalidWeatherStatementError extends ParseError {
5
- constructor(missing: string);
6
+ name: string;
7
+ cause?: unknown;
8
+ constructor(cause?: unknown);
6
9
  }
7
10
  export declare class TranslationError extends ParseError {
11
+ name: string;
8
12
  constructor(missingLocale: string);
9
13
  }
10
14
  /**
11
15
  * Should never occur
12
16
  */
13
17
  export declare class UnexpectedParseError extends ParseError {
18
+ name: string;
14
19
  constructor(message?: string);
15
20
  }