From 90b63ae082706e2dd62e297ead7ce535d4a80a54 Mon Sep 17 00:00:00 2001 From: Chika Date: Sun, 18 Sep 2022 13:44:12 +0300 Subject: [PATCH] tools/entity: use isEmpty from radash --- tools/entity.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/entity.ts b/tools/entity.ts index 3832782..12d2e86 100644 --- a/tools/entity.ts +++ b/tools/entity.ts @@ -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[]; }