From 9d0cca606b53784fd21028d5490303fbd63aa8dc Mon Sep 17 00:00:00 2001 From: jy95 Date: Thu, 11 Apr 2024 13:00:42 +0200 Subject: [PATCH] style: improve typings --- src/api.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api.ts b/src/api.ts index 7e6ac691..cc95d2c8 100644 --- a/src/api.ts +++ b/src/api.ts @@ -20,10 +20,6 @@ import type { I18N, } from "./types"; -// backends i18next -const localeImport = async (lng: Language, ns: NamespacesLocale) => - import(`./locales/${lng}/${ns}.json`); - export class FhirDosageUtils { // Configuration (Immutability has its advantages ...) config: Config; @@ -90,7 +86,8 @@ export class FhirDosageUtils { backends: [ resourcesToBackend( // have to cast the function to be webpack / builder friendly - localeImport as any, + async (lng: Language, ns: NamespacesLocale) => + import(`./locales/${lng}/${ns}.json`), ), ], },