tools/entity: use isEmpty from radash
This commit is contained in:
parent
253ca05373
commit
90b63ae082
@ -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[];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user