src/lib/stringHelpers.ts   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 13
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 4
mnd 2
bc 2
fnc 2
bpm 1
cpm 2
noi 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