(inputFormat: unknown[] | undefined)
| 240 | * @returns Sanitized input format array |
| 241 | */ |
| 242 | export function sanitizeInputFormat(inputFormat: unknown[] | undefined): Record<string, unknown>[] { |
| 243 | if (!Array.isArray(inputFormat)) return [] |
| 244 | return inputFormat.map((item) => { |
| 245 | if (item && typeof item === 'object' && !Array.isArray(item)) { |
| 246 | const { collapsed, ...rest } = item as InputFormatItem |
| 247 | return rest |
| 248 | } |
| 249 | return item as Record<string, unknown> |
| 250 | }) |
| 251 | } |
| 252 | |
| 253 | /** Normalized edge with only connection-relevant fields */ |
| 254 | interface NormalizedEdge { |
no outgoing calls
no test coverage detected