mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-28 05:14:44 +00:00
feat(package/locale): update for parity with lua
Support for nested locales (flattening) and getLocale function.
This commit is contained in:
1 parent
6da661bef3
commit
2ad3503985
2 files changed
+38
-4
No files matched your search
@@ -1 +1,8 @@
|
||||
export * from './resource';
|
||||
|
||||
// https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types/
|
||||
export type FlattenObjectKeys<T extends Record<string, unknown>, Key = keyof T> = Key extends string
|
||||
? T[Key] extends Record<string, unknown>
|
||||
? `${Key}.${FlattenObjectKeys<T[Key]>}`
|
||||
: `${Key}`
|
||||
: never;
|
||||
Reference in new issue
Block a user