metar-taf-parser 8.0.2 → 8.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -754,10 +754,10 @@ declare const _default: {
754
754
  };
755
755
  };
756
756
 
757
- type DeepPartial<T> = T extends object ? {
757
+ declare type DeepPartial<T> = T extends object ? {
758
758
  [P in keyof T]?: DeepPartial<T[P]>;
759
759
  } : T;
760
- type Locale = DeepPartial<typeof _default>;
760
+ declare type Locale = DeepPartial<typeof _default>;
761
761
 
762
762
  interface ICeilingHeightRemark extends IBaseRemark {
763
763
  type: RemarkType.CeilingHeight;
@@ -1051,7 +1051,7 @@ interface IWindShiftFropaRemark extends IBaseRemark {
1051
1051
  startMinute: number;
1052
1052
  }
1053
1053
 
1054
- type DefaultRemarkTypes = RemarkType.AO1 | RemarkType.AO2 | RemarkType.PRESFR | RemarkType.PRESRR | RemarkType.TORNADO | RemarkType.FUNNELCLOUD | RemarkType.WATERSPOUT | RemarkType.VIRGA;
1054
+ declare type DefaultRemarkTypes = RemarkType.AO1 | RemarkType.AO2 | RemarkType.PRESFR | RemarkType.PRESRR | RemarkType.TORNADO | RemarkType.FUNNELCLOUD | RemarkType.WATERSPOUT | RemarkType.VIRGA;
1055
1055
  interface IDefaultCommandRemark extends IBaseRemark {
1056
1056
  type: DefaultRemarkTypes;
1057
1057
  }
@@ -1130,7 +1130,7 @@ declare enum RemarkType {
1130
1130
  SunshineDuration = "SunshineDuration",
1131
1131
  WaterEquivalentSnow = "WaterEquivalentSnow"
1132
1132
  }
1133
- type Remark = IUnknownRemark | IDefaultCommandRemark | ICeilingHeightRemark | ICeilingSecondLocationRemark | IHailSizeRemark | IHourlyMaximumMinimumTemperatureRemark | IHourlyMaximumTemperatureRemark | IHourlyMinimumTemperatureRemark | IHourlyPrecipitationAmountRemark | IHourlyPressureRemark | IHourlyTemperatureDewPointRemark | IIceAccretionRemark | IObscurationRemark | IPrecipitationAmount24HourRemark | IPrecipitationAmount36HourRemark | IPrecipitationAmount36HourRemark | IPrecipitationBegRemark | IPrecipitationBegEndRemark | IPrecipitationEndRemark | IPrevailingVisibilityRemark | ISeaLevelPressureRemark | ISecondLocationVisibilityRemark | ISectorVisibilityRemark | ISmallHailSizeRemark | ISnowDepthRemark | ISnowIncreaseRemark | ISnowPelletsRemark | ISunshineDurationRemark | ISurfaceVisibilityRemark | IThunderStormLocationRemark | IThunderStormLocationMovingRemark | ITornadicActivityBegRemark | ITornadicActivityBegEndRemark | ITornadicActivityEndRemark | ITowerVisibilityRemark | IVariableSkyRemark | IVariableSkyHeightRemark | IVirgaDirectionRemark | IWaterEquivalentSnowRemark | IWindPeakCommandRemark | IWindShiftRemark | IWindShiftFropaRemark;
1133
+ declare type Remark = IUnknownRemark | IDefaultCommandRemark | ICeilingHeightRemark | ICeilingSecondLocationRemark | IHailSizeRemark | IHourlyMaximumMinimumTemperatureRemark | IHourlyMaximumTemperatureRemark | IHourlyMinimumTemperatureRemark | IHourlyPrecipitationAmountRemark | IHourlyPressureRemark | IHourlyTemperatureDewPointRemark | IIceAccretionRemark | IObscurationRemark | IPrecipitationAmount24HourRemark | IPrecipitationAmount36HourRemark | IPrecipitationAmount36HourRemark | IPrecipitationBegRemark | IPrecipitationBegEndRemark | IPrecipitationEndRemark | IPrevailingVisibilityRemark | ISeaLevelPressureRemark | ISecondLocationVisibilityRemark | ISectorVisibilityRemark | ISmallHailSizeRemark | ISnowDepthRemark | ISnowIncreaseRemark | ISnowPelletsRemark | ISunshineDurationRemark | ISurfaceVisibilityRemark | IThunderStormLocationRemark | IThunderStormLocationMovingRemark | ITornadicActivityBegRemark | ITornadicActivityBegEndRemark | ITornadicActivityEndRemark | ITowerVisibilityRemark | IVariableSkyRemark | IVariableSkyHeightRemark | IVirgaDirectionRemark | IWaterEquivalentSnowRemark | IWindPeakCommandRemark | IWindShiftRemark | IWindShiftFropaRemark;
1134
1134
 
1135
1135
  interface IWind {
1136
1136
  speed: number;
@@ -1154,7 +1154,7 @@ interface Distance {
1154
1154
  /** No Directional Visibility */
1155
1155
  ndv?: true;
1156
1156
  }
1157
- type Visibility = Distance & {
1157
+ declare type Visibility = Distance & {
1158
1158
  /**
1159
1159
  * Never in North American METARs
1160
1160
  */
@@ -1182,7 +1182,7 @@ interface ITemperature {
1182
1182
  interface ITemperatureDated extends ITemperature {
1183
1183
  date: Date;
1184
1184
  }
1185
- type RunwayInfo = IRunwayInfoRange | IRunwayInfoDeposit;
1185
+ declare type RunwayInfo = IRunwayInfoRange | IRunwayInfoDeposit;
1186
1186
  interface IBaseRunwayInfo {
1187
1187
  name: string;
1188
1188
  }
@@ -1376,7 +1376,7 @@ interface IBaseTAFTrend extends IAbstractTrend, ITafGroups {
1376
1376
  */
1377
1377
  validity: IAbstractValidity & Partial<IFMValidity> & Partial<IValidity>;
1378
1378
  }
1379
- type TAFTrend = IBaseTAFTrend & ({
1379
+ declare type TAFTrend = IBaseTAFTrend & ({
1380
1380
  type: WeatherChangeType.FM;
1381
1381
  validity: IFMValidity;
1382
1382
  } | {
@@ -1431,7 +1431,7 @@ interface IMetarDated extends IMetar {
1431
1431
  issued: Date;
1432
1432
  }
1433
1433
 
1434
- type TAFTrendDated = IAbstractTrend & IBaseTAFTrend & {
1434
+ declare type TAFTrendDated = IAbstractTrend & IBaseTAFTrend & {
1435
1435
  validity: IBaseTAFTrend["validity"] & {
1436
1436
  start: Date;
1437
1437
  end?: Date;
@@ -1498,9 +1498,9 @@ declare class UnexpectedParseError extends ParseError {
1498
1498
  * The initial forecast, extracted from the first line of the TAF, does not have
1499
1499
  * a trend type (FM, BECMG, etc)
1500
1500
  */
1501
- type ForecastWithoutDates = Omit<TAFTrendDated, "type"> & Partial<Pick<TAFTrendDated, "type">>;
1502
- type ForecastWithoutValidity = Omit<ForecastWithoutDates, "validity">;
1503
- type Forecast = Omit<ForecastWithoutValidity, "type"> & {
1501
+ declare type ForecastWithoutDates = Omit<TAFTrendDated, "type"> & Partial<Pick<TAFTrendDated, "type">>;
1502
+ declare type ForecastWithoutValidity = Omit<ForecastWithoutDates, "validity">;
1503
+ declare type Forecast = Omit<ForecastWithoutValidity, "type"> & {
1504
1504
  start: Date;
1505
1505
  end: Date;
1506
1506
  } & ({
@@ -1916,7 +1916,7 @@ class MainVisibilityCommand {
1916
1916
  _MainVisibilityCommand_regex = new WeakMap();
1917
1917
  class WindCommand {
1918
1918
  constructor() {
1919
- _WindCommand_regex.set(this, /^(VRB|00|[0-3]\d{2})(\d{2})G?(\d{2})?(KT|MPS|KM\/H)?/);
1919
+ _WindCommand_regex.set(this, /^(VRB|00|[0-3]\d{2})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)?/);
1920
1920
  }
1921
1921
  canParse(windString) {
1922
1922
  return __classPrivateFieldGet(this, _WindCommand_regex, "f").test(windString);
@@ -1958,7 +1958,7 @@ class WindVariationCommand {
1958
1958
  _WindVariationCommand_regex = new WeakMap();
1959
1959
  class WindShearCommand {
1960
1960
  constructor() {
1961
- _WindShearCommand_regex.set(this, /^WS(\d{3})\/(\w{3})(\d{2})G?(\d{2})?(KT|MPS|KM\/H)/);
1961
+ _WindShearCommand_regex.set(this, /^WS(\d{3})\/(\w{3})(\d{2})G?(\d{2,3})?(KT|MPS|KM\/H)/);
1962
1962
  }
1963
1963
  canParse(windString) {
1964
1964
  return __classPrivateFieldGet(this, _WindShearCommand_regex, "f").test(windString);
@@ -3069,8 +3069,8 @@ class TimestampOutOfBoundsError extends ParseError {
3069
3069
  }
3070
3070
  function getCompositeForecastForDate(date, forecastContainer) {
3071
3071
  // Validity bounds check
3072
- if (date.getTime() > forecastContainer.end.getTime() ||
3073
- date.getTime() < forecastContainer.start.getTime())
3072
+ if (date.getTime() < forecastContainer.start.getTime() ||
3073
+ date.getTime() >= forecastContainer.end.getTime())
3074
3074
  throw new TimestampOutOfBoundsError("Provided timestamp is outside the report validity period");
3075
3075
  let prevailing;
3076
3076
  let supplemental = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metar-taf-parser",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "Parse METAR and TAF reports",
5
5
  "homepage": "https://aeharding.github.io/metar-taf-parser",
6
6
  "keywords": [