From 3320c11f64d67fa47c11cf9e61b658045cbe72ba Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Wed, 27 Mar 2024 19:27:58 +0800 Subject: [PATCH] Organize exports Properly define exports. --- src/common/app.ts | 13 ++++++------- src/common/index.ts | 1 + src/index.ts | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/common/app.ts b/src/common/app.ts index 262b863..8f51fb0 100644 --- a/src/common/app.ts +++ b/src/common/app.ts @@ -1,11 +1,10 @@ import {Resource} from './resource'; -import {Language} from './language'; -import {MediaType} from './media-type'; -import {Charset} from './charset'; +import {FALLBACK_LANGUAGE, Language} from './language'; +import {FALLBACK_MEDIA_TYPE, MediaType} from './media-type'; +import {Charset, FALLBACK_CHARSET} from './charset'; import * as v from 'valibot'; import {BackendBuilder, createBackend, CreateBackendParams} from '../backend'; import {ClientBuilder, createClient, CreateClientParams} from '../client'; -import {FALLBACK_CHARSET, FALLBACK_LANGUAGE, FALLBACK_MEDIA_TYPE} from './index'; type ApplicationMap = Map; @@ -34,13 +33,13 @@ export const application = (appParams: ApplicationParams): ApplicationBuilder => const appState: ApplicationState = { name: appParams.name, resources: new Set>(), - languages: new Map([ + languages: new Map([ [FALLBACK_LANGUAGE.name, FALLBACK_LANGUAGE], ]), - mediaTypes: new Map([ + mediaTypes: new Map([ [FALLBACK_MEDIA_TYPE.name, FALLBACK_MEDIA_TYPE], ]), - charsets: new Map([ + charsets: new Map([ [FALLBACK_CHARSET.name, FALLBACK_CHARSET], ]), }; diff --git a/src/common/index.ts b/src/common/index.ts index 24ad819..44b7a47 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -7,6 +7,7 @@ export * from './charset'; export * from './media-type'; export * from './resource'; export * from './language'; +export * as validation from './validation'; export interface ContentNegotiation { language: Language; diff --git a/src/index.ts b/src/index.ts index a2c399a..7219eba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ export * from './common'; -export * as validation from './common/validation'; export * as dataSources from './backend/data-sources';