(user: any)
| 74 | * Returns null if user data is falsy. |
| 75 | */ |
| 76 | export function transformUser(user: any): { |
| 77 | accountId: string |
| 78 | displayName: string |
| 79 | active: boolean | null |
| 80 | emailAddress: string | null |
| 81 | avatarUrl: string | null |
| 82 | accountType: string | null |
| 83 | timeZone: string | null |
| 84 | } | null { |
| 85 | if (!user) return null |
| 86 | return { |
| 87 | accountId: user.accountId ?? '', |
| 88 | displayName: user.displayName ?? '', |
| 89 | active: user.active ?? null, |
| 90 | emailAddress: user.emailAddress ?? null, |
| 91 | avatarUrl: user.avatarUrls?.['48x48'] ?? null, |
| 92 | accountType: user.accountType ?? null, |
| 93 | timeZone: user.timeZone ?? null, |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Downloads Jira attachment file content given attachment metadata and an access token. |
no outgoing calls
no test coverage detected