mirror of
https://github.com/tcgdex/compiler.git
synced 2025-04-22 10:42:09 +00:00
23 lines
705 B
TypeScript
23 lines
705 B
TypeScript
import Ability from "@tcgdex/sdk/interfaces/Ability";
|
|
import { Langs } from "@tcgdex/sdk/interfaces/LangList";
|
|
import AbilityType from "@tcgdex/sdk/interfaces/AbilityType";
|
|
import { AbilitySimple, AbilitySingle } from "@tcgdex/sdk/interfaces/Ability";
|
|
import TranslationUtil from "@tcgdex/sdk/TranslationUtil";
|
|
|
|
export function abilityToAbilitySimple(ability: Ability, lang: Langs): AbilitySimple {
|
|
return {
|
|
name: ability.name[lang]
|
|
}
|
|
}
|
|
|
|
export function abilityToAbilitySingle(ability: Ability, lang: Langs): AbilitySingle {
|
|
return {
|
|
name: ability.name[lang],
|
|
text: ability.text[lang],
|
|
type: {
|
|
id: ability.type,
|
|
name: TranslationUtil.translate("abilityType", ability.type, lang)
|
|
}
|
|
}
|
|
}
|