File tree Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Expand file tree Collapse file tree 1 file changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -547,32 +547,6 @@ const getUsername = () => document.querySelector('meta[name="user-login"]')!.get
547
547
/** Drop leading and trailing slashes */
548
548
const getCleanPathname = ( url : URL | HTMLAnchorElement | Location = location ) : string => url . pathname . slice ( 1 , url . pathname . endsWith ( '/' ) ? - 1 : undefined ) ;
549
549
550
- /** Parses a repo's subpage
551
- @example '/user/repo/issues/' -> 'issues'
552
- @example '/user/repo/' -> ''
553
- @example '/settings/token/' -> undefined
554
- @deprecated Use getRepositoryInfo().path
555
- */
556
- const getRepoPath = ( url : URL | HTMLAnchorElement | Location = location ) : string | undefined => {
557
- if ( isRepo ( url ) ) {
558
- return getCleanPathname ( url ) . split ( '/' ) . slice ( 2 ) . join ( '/' ) ;
559
- }
560
-
561
- return undefined ;
562
- } ;
563
-
564
- /** Get the 'user/repo' part from an URL. Tries using the canonical URL to avoid capitalization errors in the `location` URL
565
- @deprecated Use getRepositoryInfo().url
566
- */
567
- const getRepoURL = ( url ?: URL | Location ) : string => {
568
- if ( ! url ) {
569
- const canonical = document . querySelector < HTMLMetaElement > ( '[property="og:url"]' ) ; // `rel=canonical` doesn't appear on every page
570
- url = canonical ? new URL ( canonical . content , location . origin ) : location ;
571
- }
572
-
573
- return url . pathname . slice ( 1 ) . split ( '/' , 2 ) . join ( '/' ) ;
574
- } ;
575
-
576
550
export interface RepositoryInfo {
577
551
owner : string ;
578
552
name : string ;
@@ -622,6 +596,4 @@ export const utils = {
622
596
getUsername,
623
597
getCleanPathname,
624
598
getRepositoryInfo : getRepo ,
625
- getRepoPath,
626
- getRepoURL,
627
599
} ;
You can’t perform that action at this time.
0 commit comments