9 lines
270 B
TypeScript
9 lines
270 B
TypeScript
import { elements } from '../utils/elements'
|
|
|
|
export function toObject(value: number) {
|
|
return elements.find((element) => element.id === value) || elements[0]
|
|
}
|
|
|
|
export function toParam(value: string) {
|
|
return elements.find((element) => element.name.en === value)
|
|
}
|