(value: unknown)
| 55 | } |
| 56 | |
| 57 | export function getIdArray(value: unknown): string[] { |
| 58 | if (!Array.isArray(value)) { |
| 59 | return [] |
| 60 | } |
| 61 | |
| 62 | return value.flatMap((item) => { |
| 63 | if (typeof item === 'string' && item.trim().length > 0) { |
| 64 | return [item] |
| 65 | } |
| 66 | |
| 67 | if (isRecordLike(item) && typeof item.id === 'string' && item.id.trim().length > 0) { |
| 68 | return [item.id] |
| 69 | } |
| 70 | |
| 71 | return [] |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | function mapTrelloLabel(value: unknown): TrelloLabel | null { |
| 76 | if (!isRecordLike(value) || typeof value.id !== 'string') { |
no test coverage detected