14 lines
319 B
TypeScript
14 lines
319 B
TypeScript
import type { BaseOption } from 'ui/elements/types';
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
export function normalizeOptions(options: any[] | null | undefined) {
|
|
if (!options) {
|
|
return [];
|
|
}
|
|
|
|
return options?.map(({ label, value }) => ({
|
|
label,
|
|
value,
|
|
})) as BaseOption[];
|
|
}
|