* Reads the parsed content-type choice from sourceConfig (defaults to 'both').
(sourceConfig: Record<string, unknown>)
| 206 | * Reads the parsed content-type choice from sourceConfig (defaults to 'both'). |
| 207 | */ |
| 208 | function getContentTypeChoice(sourceConfig: Record<string, unknown>): ContentTypeChoice { |
| 209 | const value = typeof sourceConfig.contentTypes === 'string' ? sourceConfig.contentTypes : 'both' |
| 210 | if ( |
| 211 | value === 'repo' || |
| 212 | value === 'wiki' || |
| 213 | value === 'issues' || |
| 214 | value === 'both' || |
| 215 | value === 'all' |
| 216 | ) { |
| 217 | return value |
| 218 | } |
| 219 | return 'both' |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Standard request headers carrying the Personal Access Token. |