Skip to content

Commit

Permalink
v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanroleplay committed Sep 6, 2021
1 parent 509c576 commit 6ebdbac
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> `Security` - in case of vulnerabilities.
## [Unreleased - 1.1.0] - 2021-09-06
## [1.1.1] - 2021-09-06

### Changed

- fixed response type for Metar.sky_condition

### Added

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aviationweather",
"version": "1.1.0",
"version": "1.1.1",
"description": "Node.js wrapper for aviation weather, written in TypeScript",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
5 changes: 2 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ export class Client {
switch (type) {
case "METARS": {
return data.map((item) => {
// remove sky condition if not present
if (!item?.sky_condition?.length) {
// delete item.sky_condition;
if (item?.sky_condition && !(item?.sky_condition instanceof Array)) {
item.sky_condition = [item?.sky_condition];
}
return item;
});
Expand Down
6 changes: 3 additions & 3 deletions src/types/responses/AW/IMetar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export interface IMetar {
/**
* Sky condition
*/
sky_condition?: {
sky_condition: {
/**
* Sky coverage
*/
sky_cover?: "NSC" | "SKC" | "CLR" | "SKT" | "BKN" | "FEW" | "OVC" | "OVCX";
sky_cover: "NSC" | "SKC" | "CLR" | "SKT" | "BKN" | "FEW" | "OVC" | "OVCX";

/**
* Cloud base (ft AGL)
Expand All @@ -93,7 +93,7 @@ export interface IMetar {
* Cloud type
*/
cloud_type?: "CB" | "TCU" | "CU";
};
}[];

/**
* Flight category of this METAR. Values: VFR|MVFR|IFR|LIFR
Expand Down
10 changes: 5 additions & 5 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Client } from "../src";
const myc = new Client({ debug: true });
myc
.AW({
datasource: "STATIONS",
stationString: "EGKB",
datasource: "METARS",
stationString: "YMML",
hoursBeforeNow: 1,
})
.then((res) => {
console.log(res[0]);
});

myc.AVT7("ZJQH").then((res) => {
console.log(res);
});
// myc.AVT7("ZJQH").then((res) => {
// console.log(res);
// });

0 comments on commit 6ebdbac

Please sign in to comment.