(obj: Record<string, unknown>, msgs: FormattableMessage[])
| 186 | } |
| 187 | |
| 188 | function formatObjectWithMessages(obj: Record<string, unknown>, msgs: FormattableMessage[]): string { |
| 189 | const lines: string[] = [] |
| 190 | |
| 191 | for (const [key, value] of Object.entries(obj)) { |
| 192 | if (key === 'messages') continue |
| 193 | if (value === undefined || value === null) continue |
| 194 | if (typeof value === 'object' && !Array.isArray(value)) continue |
| 195 | if (Array.isArray(value)) continue |
| 196 | lines.push(`${key}: ${value}`) |
| 197 | } |
| 198 | |
| 199 | const formatted = formatMessagesCompact(msgs) |
| 200 | if (formatted) { |
| 201 | if (lines.length > 0) lines.push('') |
| 202 | lines.push(formatted) |
| 203 | } |
| 204 | |
| 205 | return lines.join('\n') |
| 206 | } |
| 207 | |
| 208 | function formatArrayResult(obj: Record<string, unknown>): string { |
| 209 | const lines: string[] = [] |
no test coverage detected