Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
samarmeena committed Nov 6, 2023
1 parent a527ad9 commit 320ca5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
tests
dist
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -16,7 +20,6 @@
"require-await": "warn",
"no-await-in-loop": "warn",
"spaced-comment": "warn",
"sort-imports": "warn",
"no-unused-vars": "off",
"curly": "warn",

Expand Down
14 changes: 9 additions & 5 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import axios from "axios";
import { MetarResponse } from "./types/response/metar.js";
import { TafResponse } from "./types/response/taf.js";
import axios, { AxiosResponse } from "axios";
import { TafParams } from "./types/params/taf.js";
import { TafResponse } from "./types/response/taf.js";
import { MetarResponse } from "./types/response/metar.js";
import { MetarParams } from "./types/params/metar.js";

export const api = axios.create({
baseURL: "https://aviationweather.gov/cgi-bin/data",
});

export function getMetar(params: MetarParams) {
export function getMetar(
params: MetarParams
): Promise<AxiosResponse<MetarResponse[]>> {
return api.get<MetarResponse[]>("/metar.php", {
params,
});
}

export function getTaf(params: TafParams) {
export function getTaf(
params: TafParams
): Promise<AxiosResponse<TafResponse[]>> {
return api.get<TafResponse[]>("/metar.php", {
params,
});
Expand Down

0 comments on commit 320ca5b

Please sign in to comment.