Skip to content

Commit

Permalink
fix: explicit return types
Browse files Browse the repository at this point in the history
  • Loading branch information
fzn0x committed Jul 21, 2024
1 parent dbf586d commit 998e9ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

## Installation

```sh
```bash
bun install reacti18n
npm install reacti18n
yarn add reacti18n
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ function detectLanguage(detectionConfig: I18nConfig['detection']) {
}
}

function i18nInit(config: I18nConfig) {
interface TranslateFunction {
(key: string, req?: { headers: { cookie?: string }; url: string }): string
switch: (newLang: string, ns: string) => void
}

function i18nInit(config: I18nConfig): TranslateFunction {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const languages: Record<string, any> = {}
for (const ns in config.namespace) {
Expand Down

0 comments on commit 998e9ba

Please sign in to comment.