6 lines
249 B
TypeScript
6 lines
249 B
TypeScript
export const toQSelectOptions = <T>(values: readonly T[], i18n_domain?: string): { label: string; value: T }[] => {
|
|
return values.map(value => ({
|
|
label: ((i18n_domain ?? "") + value).toString(),
|
|
value: value as T
|
|
}));
|
|
}; |