Skip to content

Commit 8385e0e

Browse files
committed
modify types
1 parent 4b7806f commit 8385e0e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "type-locales",
3-
"version": "3.2.2",
3+
"version": "3.2.3",
44
"description": "A simple tool for typing your locales and a util for easy manage of i18n with typescript",
55
"main": "build/mod.js",
66
"bin": {

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import i18n from 'i18n'
22
import { LocaleKeys } from './keys.js'
33

44
type NestedKeyOf<T> = {
5-
[K in keyof T]: T[K] extends string
6-
? T[K]
7-
: `${NestedKeyOf<T[K]>}`
5+
[K in keyof T]: T[K] extends string ? T[K]
6+
: T[K] extends object ? NestedKeyOf<T[K]>
7+
: never
88
}[keyof T]
99

1010
interface Translate<T extends LocaleKeys = LocaleKeys> {

0 commit comments

Comments
 (0)