(types: ReadonlyArray<ContentType>)
| 283 | type ContentType = ContentPart["type"] |
| 284 | |
| 285 | const formatContentTypes = (types: ReadonlyArray<ContentType>) => { |
| 286 | if (types.length <= 1) return types[0] ?? "" |
| 287 | if (types.length === 2) return `${types[0]} and ${types[1]}` |
| 288 | return `${types.slice(0, -1).join(", ")}, and ${types.at(-1)}` |
| 289 | } |
| 290 | |
| 291 | export const supportsContent = <const Type extends ContentType>( |
| 292 | part: ContentPart, |
no test coverage detected