diff --git a/src/components/CodePreview.tsx b/src/components/CodePreview.tsx index 090a029..5bbc8fc 100644 --- a/src/components/CodePreview.tsx +++ b/src/components/CodePreview.tsx @@ -34,6 +34,10 @@ const item = (value: FieldItemType) => { const wrap = (value: Signal[]) => { const items = Object.values(value).map((val) => `${item(val.value)}`); + if (!items.length) { + return 'array();'; + } + return `array( ${items.join(',\n\t')}, );`;