{#if result != undefined} {#if resultKind && resultKind != 'json'}
as JSON 
{/if}{#if typeof result == 'object' && Object.keys(result).length > 0}
The result keys are: {truncate(Object.keys(result).join(', '), 50)} {#if !disableExpand}
{/if}
{/if}{#if !forceJson && resultKind == 'table-col'}
{#each Object.keys(result) as col}
{col}
{#if Array.isArray(result[col])} {#each result[col] as item}
{typeof item === 'string' ? item : JSON.stringify(item)}
{/each} {/if}
{/each}
{:else if !forceJson && resultKind == 'table-row'}
{#each asListOfList(result) as row} {#each row as v} {truncate(JSON.stringify(v), 200) ?? ''} {/each} {/each}
{:else if !forceJson && resultKind == 'html'}
{#if !requireHtmlApproval || enableHtml} {@html result.html} {:else}
Warning

Rendering HTML can expose you to XSS attacks. Only enable it if you trust the author of the script.

{/if}
{:else if !forceJson && resultKind == 'png'}
png rendered
{:else if !forceJson && resultKind == 'jpeg'}
jpeg rendered
{:else if !forceJson && resultKind == 'svg'}
Download
{@html result.svg}
{:else if !forceJson && resultKind == 'gif'}
gif rendered
{:else if !forceJson && resultKind == 'file'}
Download
{:else if !forceJson && resultKind == 'error'}
{#if result.error.name || result.error.message}{result.error.name}: {result.error .message}{:else}{JSON.stringify(result.error, null, 4)}{/if}
{result.error.stack ?? ''}
{#if lang && editor && diffEditor} {/if}
{:else if !forceJson && resultKind == 'approval'}
{:else} {#if jsonStr.length > 10000}
Download JSON is too large to be displayed in full.
{:else} {/if} {/if} {:else}
No result: {jsonStr}
{/if}
{#if !disableExpand} Download {#if jsonStr.length > 100000}
Download JSON is too large to be displayed in full.
{:else} {/if}
{/if}