From 041d341f6104c589f3117a4fa4df7039e9db014e Mon Sep 17 00:00:00 2001 From: George Date: Sun, 15 Oct 2023 13:51:20 +0200 Subject: [PATCH] Try publis notam decoder 6 (#34) * fix: add correct type * feat: export types --- packages/notam-decoder/src/index.ts | 9 ++++++++- packages/notam-decoder/src/lib/notam-decoder.spec.ts | 7 ------- packages/notam-decoder/src/lib/notam-decoder.ts | 3 --- packages/notam-decoder/src/reducers/notam-line.ts | 2 +- packages/notam-decoder/src/types.ts | 1 + 5 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 packages/notam-decoder/src/lib/notam-decoder.spec.ts delete mode 100644 packages/notam-decoder/src/lib/notam-decoder.ts diff --git a/packages/notam-decoder/src/index.ts b/packages/notam-decoder/src/index.ts index 0ccb736..15ad6cb 100644 --- a/packages/notam-decoder/src/index.ts +++ b/packages/notam-decoder/src/index.ts @@ -1 +1,8 @@ -export * from './lib/notam-decoder'; +export { decode } from './parse'; +export type { + NotamType, + DecodedNotam, + ScopeType, + RulesTypes, + AttentionType, +} from './types'; diff --git a/packages/notam-decoder/src/lib/notam-decoder.spec.ts b/packages/notam-decoder/src/lib/notam-decoder.spec.ts deleted file mode 100644 index 3d825c4..0000000 --- a/packages/notam-decoder/src/lib/notam-decoder.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { notamDecoder } from './notam-decoder'; - -describe('notamDecoder', () => { - it('should work', () => { - expect(notamDecoder()).toEqual('notam-decoder'); - }); -}); diff --git a/packages/notam-decoder/src/lib/notam-decoder.ts b/packages/notam-decoder/src/lib/notam-decoder.ts deleted file mode 100644 index b242799..0000000 --- a/packages/notam-decoder/src/lib/notam-decoder.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function notamDecoder(): string { - return 'notam-decoder'; -} diff --git a/packages/notam-decoder/src/reducers/notam-line.ts b/packages/notam-decoder/src/reducers/notam-line.ts index 7d5ba15..d350957 100644 --- a/packages/notam-decoder/src/reducers/notam-line.ts +++ b/packages/notam-decoder/src/reducers/notam-line.ts @@ -16,7 +16,7 @@ const reducer = (notam: DecodedNotam, line: string): DecodedNotam => { } let type: NotamType; - let affected; + let affected: string | undefined; switch (matches[1]) { case 'NOTAMN': diff --git a/packages/notam-decoder/src/types.ts b/packages/notam-decoder/src/types.ts index fd85105..6a903d7 100644 --- a/packages/notam-decoder/src/types.ts +++ b/packages/notam-decoder/src/types.ts @@ -13,6 +13,7 @@ export type ScopeType = | 'Checklist' | 'Airport/Enroute warning' | 'Airport/Navigation warning'; + export type NotamType = 'new' | 'cancel' | 'replace'; export type DecodedNotam = {