INNER CODE UNIT · TypeScript
parts
f5/unovis · packages/mcp/src/codegen/index.ts:136
const parts = value.map(item => valueExpression(item, emit)).filter((v): v is string => v !== undefined)
return `[${parts.join(', ')}]`
}
if (typeof value === 'object' && value !== null) {
const entries = Object.entries(value)
.map(([key, item]) => {
const expr = valueExpression(item, emit)
return expr === undefined ? undefined : `${key}: ${expr}`
})
.filter((v): v is string => v !== undefined)
return `{ ${entries.join(', ')} }`
}
return json(value)
}
/** Config props whose types are enums rather than plain strings — a string
* literal would not type-check, so the enum member is emitted and imported.
* (Most Unovis enums are declared `Enum | string`; these are not.) */