(value: string)
| 188 | * Kommandozeile scheitert, und laesst ihn den Fehler dort suchen. |
| 189 | */ |
| 190 | export function readRepoInput(value: string): RepoReading { |
| 191 | const trimmed = value.trim(); |
| 192 | if (trimmed.length === 0) { |
| 193 | return { ok: false, repo: '', quant: '', problem: 'empty' }; |
| 194 | } |
| 195 | if (!HF_REPO_PATTERN.test(trimmed)) { |
| 196 | return { ok: false, repo: '', quant: '', problem: 'shape' }; |
| 197 | } |
| 198 | const colon = trimmed.indexOf(':'); |
| 199 | return colon === -1 |
| 200 | ? { ok: true, repo: trimmed, quant: '', problem: '' } |
| 201 | : { ok: true, repo: trimmed.slice(0, colon), quant: trimmed.slice(colon + 1), problem: '' }; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Der fertige Aufruf, mit dem der Leser ein Modell holt. |
no outgoing calls
no test coverage detected