Skip to content

Commit 968a6cb

Browse files
committed
Export NameWithOwner type
1 parent 96827be commit 968a6cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,12 +773,17 @@ const getOrg = (url: URL | HTMLAnchorElement | Location = location): {name: stri
773773
return undefined;
774774
};
775775

776+
export type NameWithOwner = `${string}/${string}`;
777+
776778
export type RepositoryInfo = {
779+
/** The repo owner/user */
777780
owner: string;
781+
782+
/** The repo name */
778783
name: string;
779784

780785
/** The 'user/repo' part from an URL */
781-
nameWithOwner: string;
786+
nameWithOwner: NameWithOwner;
782787

783788
/** A repo's subpage
784789
@example '/user/repo/issues/' -> 'issues'
@@ -813,7 +818,7 @@ const getRepo = (url?: URL | HTMLAnchorElement | Location | string): RepositoryI
813818
return {
814819
owner,
815820
name,
816-
nameWithOwner: owner + '/' + name,
821+
nameWithOwner: `${owner}/${name}`,
817822
path: path.join('/'),
818823
};
819824
};

0 commit comments

Comments
 (0)