Total Complexity | 4 |
Complexity/F | 2 |
Lines of Code | 13 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | export function parseFullRepositoryName(fullRepositoryName: string): { owner: string; name: string } { |
||
2 | if (!fullRepositoryName.includes('/')) { |
||
3 | throw new Error(`Invalid repository name (missing "/")`); |
||
4 | } |
||
5 | |||
6 | const parts = fullRepositoryName.split('/'); |
||
7 | |||
8 | return { |
||
9 | owner: parts[0], |
||
10 | name: parts[1], |
||
11 | }; |
||
12 | } |
||
13 |