From d2db61f9e88341848683f9d02a96e93a8a2af5d7 Mon Sep 17 00:00:00 2001 From: Kiri111enz Date: Tue, 30 Jan 2024 16:48:03 +0300 Subject: [PATCH] refactor --- src/includer/traverse/tables.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/includer/traverse/tables.ts b/src/includer/traverse/tables.ts index cf31089..d0047c4 100644 --- a/src/includer/traverse/tables.ts +++ b/src/includer/traverse/tables.ts @@ -157,10 +157,8 @@ export function prepareTableRowData( }; } - const returnType = - (inner.ref?.length || inner.type.split('\n').length || 0) <= 1 - ? `${inner.type}[]` - : `(${inner.type})[]`; + const isUnionType = (inner.ref?.length || inner.type.split('\n').length || 0) > 1; + const returnType = isUnionType ? `(${inner.type})[]` : `${inner.type}[]`; return { type: returnType,