Skip to content

Commit

Permalink
fix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Jun 15, 2023
1 parent f4ac600 commit d14fc0d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/serverSideTranslations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { globalI18n } from './appWithTranslation'

import { UserConfig, SSRConfig } from './types'
import { getFallbackForLng, unique } from './utils'
import { Namespace } from 'i18next'

let DEFAULT_CONFIG_PATH = './next-i18next.config.js'

Expand All @@ -22,12 +21,11 @@ if (process.env.I18NEXT_DEFAULT_CONFIG_PATH) {
DEFAULT_CONFIG_PATH = process.env.I18NEXT_DEFAULT_CONFIG_PATH
}

type ArrayElementOrSelf<T> = T extends Array<infer U> ? U[] : T[]

export const serverSideTranslations = async (
initialLocale: string,
namespacesRequired:
| ArrayElementOrSelf<Namespace>
| string
| string[]
| undefined = undefined,
configOverride: UserConfig | null = null,
extraLocales: string[] | false = false
Expand Down

0 comments on commit d14fc0d

Please sign in to comment.