metar-taf-parser 3.1.2 → 4.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.
- package/README.md +1 -1
- package/{dist/locale → locale}/de.d.ts +0 -0
- package/{dist/locale → locale}/de.js +3 -3
- package/{dist/locale → locale}/en.d.ts +0 -0
- package/{dist/locale → locale}/en.js +3 -3
- package/{dist/locale → locale}/fr.d.ts +0 -0
- package/{dist/locale → locale}/fr.js +3 -3
- package/{dist/locale → locale}/it.d.ts +0 -0
- package/{dist/locale → locale}/it.js +3 -3
- package/{dist/locale → locale}/pl.d.ts +0 -0
- package/{dist/locale → locale}/pl.js +3 -3
- package/{dist/locale → locale}/zh-CN.d.ts +0 -0
- package/{dist/locale → locale}/zh-CN.js +3 -3
- package/metar-taf-parser.d.ts +1325 -0
- package/metar-taf-parser.js +2703 -0
- package/package.json +23 -16
- package/dist/command/common.d.ts +0 -54
- package/dist/command/common.js +0 -243
- package/dist/command/metar/AltimeterCommand.d.ts +0 -7
- package/dist/command/metar/AltimeterCommand.js +0 -26
- package/dist/command/metar/AltimeterMercuryCommand.d.ts +0 -7
- package/dist/command/metar/AltimeterMercuryCommand.js +0 -51
- package/dist/command/metar/RunwayCommand.d.ts +0 -7
- package/dist/command/metar/RunwayCommand.js +0 -60
- package/dist/command/metar/TemperatureCommand.d.ts +0 -7
- package/dist/command/metar/TemperatureCommand.js +0 -51
- package/dist/command/metar.d.ts +0 -9
- package/dist/command/metar.js +0 -31
- package/dist/command/remark/CeilingHeightCommand.d.ts +0 -18
- package/dist/command/remark/CeilingHeightCommand.js +0 -40
- package/dist/command/remark/CeilingSecondLocationCommand.d.ts +0 -12
- package/dist/command/remark/CeilingSecondLocationCommand.js +0 -40
- package/dist/command/remark/Command.d.ts +0 -8
- package/dist/command/remark/Command.js +0 -9
- package/dist/command/remark/DefaultCommand.d.ts +0 -11
- package/dist/command/remark/DefaultCommand.js +0 -38
- package/dist/command/remark/HailSizeCommand.d.ts +0 -11
- package/dist/command/remark/HailSizeCommand.js +0 -38
- package/dist/command/remark/HourlyMaximumMinimumTemperatureCommand.d.ts +0 -18
- package/dist/command/remark/HourlyMaximumMinimumTemperatureCommand.js +0 -39
- package/dist/command/remark/HourlyMaximumTemperatureCommand.d.ts +0 -14
- package/dist/command/remark/HourlyMaximumTemperatureCommand.js +0 -38
- package/dist/command/remark/HourlyMinimumTemperatureCommand.d.ts +0 -14
- package/dist/command/remark/HourlyMinimumTemperatureCommand.js +0 -38
- package/dist/command/remark/HourlyPrecipitationAmountCommand.d.ts +0 -14
- package/dist/command/remark/HourlyPrecipitationAmountCommand.js +0 -38
- package/dist/command/remark/HourlyPressureCommand.d.ts +0 -32
- package/dist/command/remark/HourlyPressureCommand.js +0 -40
- package/dist/command/remark/HourlyTemperatureDewPointCommand.d.ts +0 -18
- package/dist/command/remark/HourlyTemperatureDewPointCommand.js +0 -52
- package/dist/command/remark/IceAccretionCommand.d.ts +0 -15
- package/dist/command/remark/IceAccretionCommand.js +0 -38
- package/dist/command/remark/ObscurationCommand.d.ts +0 -14
- package/dist/command/remark/ObscurationCommand.js +0 -44
- package/dist/command/remark/PrecipitationAmount24HourCommand.d.ts +0 -14
- package/dist/command/remark/PrecipitationAmount24HourCommand.js +0 -39
- package/dist/command/remark/PrecipitationAmount36HourCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationAmount36HourCommand.js +0 -41
- package/dist/command/remark/PrecipitationBegCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationBegCommand.js +0 -45
- package/dist/command/remark/PrecipitationBegEndCommand.d.ts +0 -17
- package/dist/command/remark/PrecipitationBegEndCommand.js +0 -46
- package/dist/command/remark/PrecipitationEndCommand.d.ts +0 -15
- package/dist/command/remark/PrecipitationEndCommand.js +0 -45
- package/dist/command/remark/PrevailingVisibilityCommand.d.ts +0 -12
- package/dist/command/remark/PrevailingVisibilityCommand.js +0 -41
- package/dist/command/remark/SeaLevelPressureCommand.d.ts +0 -11
- package/dist/command/remark/SeaLevelPressureCommand.js +0 -39
- package/dist/command/remark/SecondLocationVisibilityCommand.d.ts +0 -12
- package/dist/command/remark/SecondLocationVisibilityCommand.js +0 -41
- package/dist/command/remark/SectorVisibilityCommand.d.ts +0 -13
- package/dist/command/remark/SectorVisibilityCommand.js +0 -42
- package/dist/command/remark/SmallHailSizeCommand.d.ts +0 -11
- package/dist/command/remark/SmallHailSizeCommand.js +0 -38
- package/dist/command/remark/SnowDepthCommand.d.ts +0 -11
- package/dist/command/remark/SnowDepthCommand.js +0 -38
- package/dist/command/remark/SnowIncreaseCommand.d.ts +0 -12
- package/dist/command/remark/SnowIncreaseCommand.js +0 -40
- package/dist/command/remark/SnowPelletsCommand.d.ts +0 -11
- package/dist/command/remark/SnowPelletsCommand.js +0 -37
- package/dist/command/remark/SunshineDurationCommand.d.ts +0 -11
- package/dist/command/remark/SunshineDurationCommand.js +0 -38
- package/dist/command/remark/SurfaceVisibilityCommand.d.ts +0 -11
- package/dist/command/remark/SurfaceVisibilityCommand.js +0 -39
- package/dist/command/remark/ThunderStormLocationCommand.d.ts +0 -12
- package/dist/command/remark/ThunderStormLocationCommand.js +0 -40
- package/dist/command/remark/ThunderStormLocationMovingCommand.d.ts +0 -19
- package/dist/command/remark/ThunderStormLocationMovingCommand.js +0 -42
- package/dist/command/remark/TornadicActivityBegCommand.d.ts +0 -16
- package/dist/command/remark/TornadicActivityBegCommand.js +0 -44
- package/dist/command/remark/TornadicActivityBegEndCommand.d.ts +0 -18
- package/dist/command/remark/TornadicActivityBegEndCommand.js +0 -46
- package/dist/command/remark/TornadicActivityEndCommand.d.ts +0 -16
- package/dist/command/remark/TornadicActivityEndCommand.js +0 -44
- package/dist/command/remark/TowerVisibilityCommand.d.ts +0 -11
- package/dist/command/remark/TowerVisibilityCommand.js +0 -39
- package/dist/command/remark/VariableSkyCommand.d.ts +0 -12
- package/dist/command/remark/VariableSkyCommand.js +0 -41
- package/dist/command/remark/VariableSkyHeightCommand.d.ts +0 -13
- package/dist/command/remark/VariableSkyHeightCommand.js +0 -43
- package/dist/command/remark/VirgaDirectionCommand.d.ts +0 -12
- package/dist/command/remark/VirgaDirectionCommand.js +0 -40
- package/dist/command/remark/WaterEquivalentSnowCommand.d.ts +0 -11
- package/dist/command/remark/WaterEquivalentSnowCommand.js +0 -38
- package/dist/command/remark/WindPeakCommandCommand.d.ts +0 -17
- package/dist/command/remark/WindPeakCommandCommand.js +0 -42
- package/dist/command/remark/WindShiftCommand.d.ts +0 -12
- package/dist/command/remark/WindShiftCommand.js +0 -38
- package/dist/command/remark/WindShiftFropaCommand.d.ts +0 -12
- package/dist/command/remark/WindShiftFropaCommand.js +0 -38
- package/dist/command/remark.d.ts +0 -109
- package/dist/command/remark.js +0 -152
- package/dist/commons/converter.d.ts +0 -21
- package/dist/commons/converter.js +0 -108
- package/dist/commons/errors.d.ts +0 -24
- package/dist/commons/errors.js +0 -46
- package/dist/commons/i18n.d.ts +0 -12
- package/dist/commons/i18n.js +0 -30
- package/dist/dates/metar.d.ts +0 -5
- package/dist/dates/metar.js +0 -8
- package/dist/dates/taf.d.ts +0 -28
- package/dist/dates/taf.js +0 -17
- package/dist/forecast/forecast.d.ts +0 -36
- package/dist/forecast/forecast.js +0 -72
- package/dist/helpers/date.d.ts +0 -11
- package/dist/helpers/date.js +0 -56
- package/dist/helpers/helpers.d.ts +0 -17
- package/dist/helpers/helpers.js +0 -46
- package/dist/index.d.ts +0 -32
- package/dist/index.js +0 -62
- package/dist/model/enum.d.ts +0 -265
- package/dist/model/enum.js +0 -280
- package/dist/model/model.d.ts +0 -188
- package/dist/model/model.js +0 -11
- package/dist/parser/parser.d.ts +0 -111
- package/dist/parser/parser.js +0 -480
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CloudQuantity, Phenomenon } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IObscurationRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.Obscuration;
|
|
6
|
-
quantity: CloudQuantity;
|
|
7
|
-
height: number;
|
|
8
|
-
phenomenon: Phenomenon;
|
|
9
|
-
}
|
|
10
|
-
export declare class ObscurationCommand extends Command {
|
|
11
|
-
#private;
|
|
12
|
-
canParse(code: string): boolean;
|
|
13
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
14
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _ObscurationCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ObscurationCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class ObscurationCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_ObscurationCommand_regex.set(this, /^([A-Z]{2}) ([A-Z]{3})(\d{3})/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _ObscurationCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _ObscurationCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const quantity = (0, helpers_1.as)(matches[2], enum_1.CloudQuantity);
|
|
29
|
-
const height = 100 * +matches[3];
|
|
30
|
-
const phenomenon = (0, helpers_1.as)(matches[1], enum_1.Phenomenon);
|
|
31
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Obscuration", this.locale), (0, i18n_1._)(`CloudQuantity.${quantity}`, this.locale), height, (0, i18n_1._)(`Phenomenon.${phenomenon}`, this.locale));
|
|
32
|
-
remark.push({
|
|
33
|
-
type: remark_1.RemarkType.Obscuration,
|
|
34
|
-
description,
|
|
35
|
-
raw: matches[0],
|
|
36
|
-
quantity,
|
|
37
|
-
height,
|
|
38
|
-
phenomenon,
|
|
39
|
-
});
|
|
40
|
-
return [code.replace(__classPrivateFieldGet(this, _ObscurationCommand_regex, "f"), "").trim(), remark];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.ObscurationCommand = ObscurationCommand;
|
|
44
|
-
_ObscurationCommand_regex = new WeakMap();
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface IPrecipitationAmount24HourRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.PrecipitationAmount24Hour;
|
|
5
|
-
/**
|
|
6
|
-
* In inches
|
|
7
|
-
*/
|
|
8
|
-
amount: number;
|
|
9
|
-
}
|
|
10
|
-
export declare class PrecipitationAmount24HourCommand extends Command {
|
|
11
|
-
#private;
|
|
12
|
-
canParse(code: string): boolean;
|
|
13
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
14
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrecipitationAmount24HourCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrecipitationAmount24HourCommand = void 0;
|
|
10
|
-
const converter_1 = require("../../commons/converter");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const remark_1 = require("../remark");
|
|
14
|
-
const Command_1 = require("./Command");
|
|
15
|
-
class PrecipitationAmount24HourCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_PrecipitationAmount24HourCommand_regex.set(this, /^7(\d{4})\b/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const amount = (0, converter_1.convertPrecipitationAmount)(matches[1]);
|
|
28
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Amount.24", this.locale), amount);
|
|
29
|
-
remark.push({
|
|
30
|
-
type: remark_1.RemarkType.PrecipitationAmount24Hour,
|
|
31
|
-
description,
|
|
32
|
-
raw: matches[0],
|
|
33
|
-
amount,
|
|
34
|
-
});
|
|
35
|
-
return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount24HourCommand_regex, "f"), "").trim(), remark];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.PrecipitationAmount24HourCommand = PrecipitationAmount24HourCommand;
|
|
39
|
-
_PrecipitationAmount24HourCommand_regex = new WeakMap();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface IPrecipitationAmount36HourRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.PrecipitationAmount36Hour;
|
|
5
|
-
periodInHours: 3 | 6;
|
|
6
|
-
/**
|
|
7
|
-
* In inches
|
|
8
|
-
*/
|
|
9
|
-
amount: number;
|
|
10
|
-
}
|
|
11
|
-
export declare class PrecipitationAmount36HourCommand extends Command {
|
|
12
|
-
#private;
|
|
13
|
-
canParse(code: string): boolean;
|
|
14
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
15
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrecipitationAmount36HourCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrecipitationAmount36HourCommand = void 0;
|
|
10
|
-
const converter_1 = require("../../commons/converter");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const remark_1 = require("../remark");
|
|
14
|
-
const Command_1 = require("./Command");
|
|
15
|
-
class PrecipitationAmount36HourCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_PrecipitationAmount36HourCommand_regex.set(this, /^([36])(\d{4})\b/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const periodInHours = +matches[1];
|
|
28
|
-
const amount = (0, converter_1.convertPrecipitationAmount)(matches[2]);
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Amount.3.6", this.locale), periodInHours, amount);
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.PrecipitationAmount36Hour,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
periodInHours,
|
|
35
|
-
amount,
|
|
36
|
-
});
|
|
37
|
-
return [code.replace(__classPrivateFieldGet(this, _PrecipitationAmount36HourCommand_regex, "f"), "").trim(), remark];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.PrecipitationAmount36HourCommand = PrecipitationAmount36HourCommand;
|
|
41
|
-
_PrecipitationAmount36HourCommand_regex = new WeakMap();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Descriptive, Phenomenon } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IPrecipitationBegRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.PrecipitationBeg;
|
|
6
|
-
descriptive?: Descriptive;
|
|
7
|
-
phenomenon: Phenomenon;
|
|
8
|
-
startHour?: number;
|
|
9
|
-
startMin: number;
|
|
10
|
-
}
|
|
11
|
-
export declare class PrecipitationBegCommand extends Command {
|
|
12
|
-
#private;
|
|
13
|
-
canParse(code: string): boolean;
|
|
14
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
15
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrecipitationBegCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrecipitationBegCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class PrecipitationBegCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_PrecipitationBegCommand_regex.set(this, /^(([A-Z]{2})?([A-Z]{2})B(\d{2})?(\d{2}))/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _PrecipitationBegCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
var _a;
|
|
26
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrecipitationBegCommand_regex, "f"));
|
|
27
|
-
if (!matches)
|
|
28
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
29
|
-
const descriptive = matches[2] ? (0, helpers_1.as)(matches[2], enum_1.Descriptive) : undefined;
|
|
30
|
-
const phenomenon = (0, helpers_1.as)(matches[3], enum_1.Phenomenon);
|
|
31
|
-
const description = (_a = (0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Beg.0", this.locale), descriptive ? (0, i18n_1._)(`Descriptive.${descriptive}`, this.locale) : "", (0, i18n_1._)(`Phenomenon.${phenomenon}`, this.locale), matches[4] || "", matches[5])) === null || _a === void 0 ? void 0 : _a.trim();
|
|
32
|
-
remark.push({
|
|
33
|
-
type: remark_1.RemarkType.PrecipitationBeg,
|
|
34
|
-
description,
|
|
35
|
-
raw: matches[0],
|
|
36
|
-
descriptive,
|
|
37
|
-
phenomenon,
|
|
38
|
-
startHour: matches[4] ? +matches[4] : undefined,
|
|
39
|
-
startMin: +matches[5],
|
|
40
|
-
});
|
|
41
|
-
return [code.replace(__classPrivateFieldGet(this, _PrecipitationBegCommand_regex, "f"), "").trim(), remark];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.PrecipitationBegCommand = PrecipitationBegCommand;
|
|
45
|
-
_PrecipitationBegCommand_regex = new WeakMap();
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Descriptive, Phenomenon } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IPrecipitationBegEndRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.PrecipitationBegEnd;
|
|
6
|
-
descriptive?: Descriptive;
|
|
7
|
-
phenomenon: Phenomenon;
|
|
8
|
-
startHour?: number;
|
|
9
|
-
startMin: number;
|
|
10
|
-
endHour?: number;
|
|
11
|
-
endMin: number;
|
|
12
|
-
}
|
|
13
|
-
export declare class PrecipitationBegEndCommand extends Command {
|
|
14
|
-
#private;
|
|
15
|
-
canParse(code: string): boolean;
|
|
16
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
17
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrecipitationBegEndCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrecipitationBegEndCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class PrecipitationBegEndCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_PrecipitationBegEndCommand_regex.set(this, /^(([A-Z]{2})?([A-Z]{2})B(\d{2})?(\d{2})E(\d{2})?(\d{2}))/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f"));
|
|
26
|
-
if (!matches)
|
|
27
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
28
|
-
const descriptive = matches[2] ? (0, helpers_1.as)(matches[2], enum_1.Descriptive) : undefined;
|
|
29
|
-
const phenomenon = (0, helpers_1.as)(matches[3], enum_1.Phenomenon);
|
|
30
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.Beg.End", this.locale), descriptive ? (0, i18n_1._)(`Descriptive.${descriptive}`, this.locale) : "", (0, i18n_1._)(`Phenomenon.${phenomenon}`, this.locale), matches[4] || "", matches[5], matches[6] || "", matches[7]);
|
|
31
|
-
remark.push({
|
|
32
|
-
type: remark_1.RemarkType.PrecipitationBegEnd,
|
|
33
|
-
description,
|
|
34
|
-
raw: matches[0],
|
|
35
|
-
descriptive,
|
|
36
|
-
phenomenon,
|
|
37
|
-
startHour: matches[4] ? +matches[4] : undefined,
|
|
38
|
-
startMin: +matches[5],
|
|
39
|
-
endHour: matches[6] ? +matches[6] : undefined,
|
|
40
|
-
endMin: +matches[7],
|
|
41
|
-
});
|
|
42
|
-
return [code.replace(__classPrivateFieldGet(this, _PrecipitationBegEndCommand_regex, "f"), "").trim(), remark];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.PrecipitationBegEndCommand = PrecipitationBegEndCommand;
|
|
46
|
-
_PrecipitationBegEndCommand_regex = new WeakMap();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Descriptive, Phenomenon } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface IPrecipitationEndRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.PrecipitationEnd;
|
|
6
|
-
descriptive?: Descriptive;
|
|
7
|
-
phenomenon: Phenomenon;
|
|
8
|
-
endHour?: number;
|
|
9
|
-
endMin: number;
|
|
10
|
-
}
|
|
11
|
-
export declare class PrecipitationEndCommand extends Command {
|
|
12
|
-
#private;
|
|
13
|
-
canParse(code: string): boolean;
|
|
14
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
15
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrecipitationEndCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrecipitationEndCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
class PrecipitationEndCommand extends Command_1.Command {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_PrecipitationEndCommand_regex.set(this, /^(([A-Z]{2})?([A-Z]{2})E(\d{2})?(\d{2}))/);
|
|
20
|
-
}
|
|
21
|
-
canParse(code) {
|
|
22
|
-
return __classPrivateFieldGet(this, _PrecipitationEndCommand_regex, "f").test(code);
|
|
23
|
-
}
|
|
24
|
-
execute(code, remark) {
|
|
25
|
-
var _a;
|
|
26
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrecipitationEndCommand_regex, "f"));
|
|
27
|
-
if (!matches)
|
|
28
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
29
|
-
const descriptive = matches[2] ? (0, helpers_1.as)(matches[2], enum_1.Descriptive) : undefined;
|
|
30
|
-
const phenomenon = (0, helpers_1.as)(matches[3], enum_1.Phenomenon);
|
|
31
|
-
const description = (_a = (0, i18n_1.format)((0, i18n_1._)("Remark.Precipitation.End", this.locale), descriptive ? (0, i18n_1._)(`Descriptive.${descriptive}`, this.locale) : "", (0, i18n_1._)(`Phenomenon.${phenomenon}`, this.locale), matches[4] || "", matches[5])) === null || _a === void 0 ? void 0 : _a.trim();
|
|
32
|
-
remark.push({
|
|
33
|
-
type: remark_1.RemarkType.PrecipitationEnd,
|
|
34
|
-
description,
|
|
35
|
-
raw: matches[0],
|
|
36
|
-
descriptive,
|
|
37
|
-
phenomenon,
|
|
38
|
-
endHour: matches[4] ? +matches[4] : undefined,
|
|
39
|
-
endMin: +matches[5],
|
|
40
|
-
});
|
|
41
|
-
return [code.replace(__classPrivateFieldGet(this, _PrecipitationEndCommand_regex, "f"), "").trim(), remark];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.PrecipitationEndCommand = PrecipitationEndCommand;
|
|
45
|
-
_PrecipitationEndCommand_regex = new WeakMap();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface IPrevailingVisibilityRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.PrevailingVisibility;
|
|
5
|
-
minVisibility: number;
|
|
6
|
-
maxVisibility: number;
|
|
7
|
-
}
|
|
8
|
-
export declare class PrevailingVisibilityCommand extends Command {
|
|
9
|
-
#private;
|
|
10
|
-
canParse(code: string): boolean;
|
|
11
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
12
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _PrevailingVisibilityCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PrevailingVisibilityCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
const converter_1 = require("../../commons/converter");
|
|
15
|
-
class PrevailingVisibilityCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_PrevailingVisibilityCommand_regex.set(this, /^VIS ((\d)*( )?(\d?\/?\d))V((\d)*( )?(\d?\/?\d))/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const minVisibility = matches[1];
|
|
28
|
-
const maxVisibility = matches[5];
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Variable.Prevailing.Visibility", this.locale), minVisibility, maxVisibility);
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.PrevailingVisibility,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
minVisibility: (0, converter_1.convertFractionalAmount)(minVisibility),
|
|
35
|
-
maxVisibility: (0, converter_1.convertFractionalAmount)(maxVisibility),
|
|
36
|
-
});
|
|
37
|
-
return [code.replace(__classPrivateFieldGet(this, _PrevailingVisibilityCommand_regex, "f"), "").trim(), remark];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.PrevailingVisibilityCommand = PrevailingVisibilityCommand;
|
|
41
|
-
_PrevailingVisibilityCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISeaLevelPressureRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SeaLevelPressure;
|
|
5
|
-
pressure: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SeaLevelPressureCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SeaLevelPressureCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SeaLevelPressureCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
class SeaLevelPressureCommand extends Command_1.Command {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
_SeaLevelPressureCommand_regex.set(this, /^SLP(\d{2})(\d)/);
|
|
18
|
-
}
|
|
19
|
-
canParse(code) {
|
|
20
|
-
return __classPrivateFieldGet(this, _SeaLevelPressureCommand_regex, "f").test(code);
|
|
21
|
-
}
|
|
22
|
-
execute(code, remark) {
|
|
23
|
-
const matches = code.match(__classPrivateFieldGet(this, _SeaLevelPressureCommand_regex, "f"));
|
|
24
|
-
if (!matches)
|
|
25
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
26
|
-
let pressure = matches[1].startsWith("9") ? "9" : "10";
|
|
27
|
-
pressure += matches[1] + "." + matches[2];
|
|
28
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Sea.Level.Pressure", this.locale), pressure);
|
|
29
|
-
remark.push({
|
|
30
|
-
type: remark_1.RemarkType.SeaLevelPressure,
|
|
31
|
-
description,
|
|
32
|
-
raw: matches[0],
|
|
33
|
-
pressure: +pressure,
|
|
34
|
-
});
|
|
35
|
-
return [code.replace(__classPrivateFieldGet(this, _SeaLevelPressureCommand_regex, "f"), "").trim(), remark];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.SeaLevelPressureCommand = SeaLevelPressureCommand;
|
|
39
|
-
_SeaLevelPressureCommand_regex = new WeakMap();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISecondLocationVisibilityRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SecondLocationVisibility;
|
|
5
|
-
distance: number;
|
|
6
|
-
location: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class SecondLocationVisibilityCommand extends Command {
|
|
9
|
-
#private;
|
|
10
|
-
canParse(code: string): boolean;
|
|
11
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
12
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SecondLocationVisibilityCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SecondLocationVisibilityCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
const converter_1 = require("../../commons/converter");
|
|
15
|
-
class SecondLocationVisibilityCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_SecondLocationVisibilityCommand_regex.set(this, /^VIS ((\d)*( )?(\d?\/?\d)) (\w+)/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const distance = matches[1];
|
|
28
|
-
const location = matches[5];
|
|
29
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Second.Location.Visibility", this.locale), distance, location);
|
|
30
|
-
remark.push({
|
|
31
|
-
type: remark_1.RemarkType.SecondLocationVisibility,
|
|
32
|
-
description,
|
|
33
|
-
raw: matches[0],
|
|
34
|
-
distance: (0, converter_1.convertFractionalAmount)(distance),
|
|
35
|
-
location,
|
|
36
|
-
});
|
|
37
|
-
return [code.replace(__classPrivateFieldGet(this, _SecondLocationVisibilityCommand_regex, "f"), "").trim(), remark];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.SecondLocationVisibilityCommand = SecondLocationVisibilityCommand;
|
|
41
|
-
_SecondLocationVisibilityCommand_regex = new WeakMap();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Direction } from "../../model/enum";
|
|
2
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
3
|
-
import { Command } from "./Command";
|
|
4
|
-
export interface ISectorVisibilityRemark extends IBaseRemark {
|
|
5
|
-
type: RemarkType.SectorVisibility;
|
|
6
|
-
direction: Direction;
|
|
7
|
-
distance: number;
|
|
8
|
-
}
|
|
9
|
-
export declare class SectorVisibilityCommand extends Command {
|
|
10
|
-
#private;
|
|
11
|
-
canParse(code: string): boolean;
|
|
12
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
13
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SectorVisibilityCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SectorVisibilityCommand = void 0;
|
|
10
|
-
const helpers_1 = require("../../helpers/helpers");
|
|
11
|
-
const i18n_1 = require("../../commons/i18n");
|
|
12
|
-
const errors_1 = require("../../commons/errors");
|
|
13
|
-
const enum_1 = require("../../model/enum");
|
|
14
|
-
const remark_1 = require("../remark");
|
|
15
|
-
const Command_1 = require("./Command");
|
|
16
|
-
const converter_1 = require("../../commons/converter");
|
|
17
|
-
class SectorVisibilityCommand extends Command_1.Command {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
_SectorVisibilityCommand_regex.set(this, /^VIS ([A-Z]{1,2}) ((\d)*( )?(\d?\/?\d))/);
|
|
21
|
-
}
|
|
22
|
-
canParse(code) {
|
|
23
|
-
return __classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f").test(code);
|
|
24
|
-
}
|
|
25
|
-
execute(code, remark) {
|
|
26
|
-
const matches = code.match(__classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f"));
|
|
27
|
-
if (!matches)
|
|
28
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
29
|
-
const direction = (0, helpers_1.as)(matches[1], enum_1.Direction);
|
|
30
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Sector.Visibility", this.locale), (0, i18n_1._)(`Converter.${direction}`, this.locale), matches[2]);
|
|
31
|
-
remark.push({
|
|
32
|
-
type: remark_1.RemarkType.SectorVisibility,
|
|
33
|
-
description,
|
|
34
|
-
raw: matches[0],
|
|
35
|
-
direction,
|
|
36
|
-
distance: (0, converter_1.convertFractionalAmount)(matches[2]),
|
|
37
|
-
});
|
|
38
|
-
return [code.replace(__classPrivateFieldGet(this, _SectorVisibilityCommand_regex, "f"), "").trim(), remark];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.SectorVisibilityCommand = SectorVisibilityCommand;
|
|
42
|
-
_SectorVisibilityCommand_regex = new WeakMap();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IBaseRemark, RemarkType, Remark } from "../remark";
|
|
2
|
-
import { Command } from "./Command";
|
|
3
|
-
export interface ISmallHailSizeRemark extends IBaseRemark {
|
|
4
|
-
type: RemarkType.SmallHailSize;
|
|
5
|
-
size: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class SmallHailSizeCommand extends Command {
|
|
8
|
-
#private;
|
|
9
|
-
canParse(code: string): boolean;
|
|
10
|
-
execute(code: string, remark: Remark[]): [string, Remark[]];
|
|
11
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _SmallHailSizeCommand_regex;
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.SmallHailSizeCommand = void 0;
|
|
10
|
-
const i18n_1 = require("../../commons/i18n");
|
|
11
|
-
const errors_1 = require("../../commons/errors");
|
|
12
|
-
const remark_1 = require("../remark");
|
|
13
|
-
const Command_1 = require("./Command");
|
|
14
|
-
const converter_1 = require("../../commons/converter");
|
|
15
|
-
class SmallHailSizeCommand extends Command_1.Command {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
_SmallHailSizeCommand_regex.set(this, /^GR LESS THAN ((\d )?(\d\/\d)?)/);
|
|
19
|
-
}
|
|
20
|
-
canParse(code) {
|
|
21
|
-
return __classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f").test(code);
|
|
22
|
-
}
|
|
23
|
-
execute(code, remark) {
|
|
24
|
-
const matches = code.match(__classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f"));
|
|
25
|
-
if (!matches)
|
|
26
|
-
throw new errors_1.UnexpectedParseError("Match not found");
|
|
27
|
-
const description = (0, i18n_1.format)((0, i18n_1._)("Remark.Hail.LesserThan", this.locale), matches[1]);
|
|
28
|
-
remark.push({
|
|
29
|
-
type: remark_1.RemarkType.SmallHailSize,
|
|
30
|
-
description,
|
|
31
|
-
raw: matches[0],
|
|
32
|
-
size: (0, converter_1.convertFractionalAmount)(matches[1]),
|
|
33
|
-
});
|
|
34
|
-
return [code.replace(__classPrivateFieldGet(this, _SmallHailSizeCommand_regex, "f"), "").trim(), remark];
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.SmallHailSizeCommand = SmallHailSizeCommand;
|
|
38
|
-
_SmallHailSizeCommand_regex = new WeakMap();
|