mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-17 13:38:07 +01:00
15 lines
378 B
TypeScript
15 lines
378 B
TypeScript
import { defu } from 'defu'
|
|
import type { Locale, Direction } from '../types/locale'
|
|
|
|
interface DefineLocaleOptions<M> {
|
|
name: string
|
|
code: string
|
|
dir?: Direction
|
|
messages: M
|
|
}
|
|
|
|
/* @__NO_SIDE_EFFECTS__ */
|
|
export function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M> {
|
|
return defu<DefineLocaleOptions<M>, [{ dir: Direction }]>(options, { dir: 'ltr' })
|
|
}
|