mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-08-06 12:21:57 +00:00
15
interfaces/LangList.ts
Normal file
15
interfaces/LangList.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
type LangList<T> = {
|
||||
[key in Langs]?: T
|
||||
}
|
||||
|
||||
export type Langs = "en" | "fr"
|
||||
|
||||
namespace LangList {
|
||||
export function insert(from: LangList<any>, el: any, lang: Langs) {
|
||||
if (typeof from !== "object") from = {}
|
||||
from[lang] = el
|
||||
return from
|
||||
}
|
||||
}
|
||||
|
||||
export default LangList
|
Reference in New Issue
Block a user