tools/entity: use isEmpty from radash

This commit is contained in:
Chika 2022-09-18 13:44:12 +03:00
parent 253ca05373
commit 90b63ae082

View File

@ -1,8 +1,7 @@
/* eslint-disable import/prefer-default-export */
import type { BaseOption } from 'Elements/types';
import { isEmpty } from 'radash/dist/typed';
export function normalizeOptions(options: any[] | null | undefined) {
if (options === null || options === undefined) return [];
return options as BaseOption[];
return (isEmpty(options) ? [] : options) as BaseOption[];
}