diff options
Diffstat (limited to 'source/github-helpers/github-url.ts')
-rw-r--r-- | source/github-helpers/github-url.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/github-helpers/github-url.ts b/source/github-helpers/github-url.ts index 1966ee2a..97c347a0 100644 --- a/source/github-helpers/github-url.ts +++ b/source/github-helpers/github-url.ts @@ -12,8 +12,6 @@ export default class GitHubURL { // @ts-expect-error filePath: string; - assign = Object.assign.bind(null, this); - private internalUrl: URL; constructor(url: string) { @@ -30,6 +28,11 @@ export default class GitHubURL { return this.href; } + assign(...replacements: Array<Partial<GitHubURL>>): this { + Object.assign(this, ...replacements); + return this; + } + private disambiguateReference(ambiguousReference: string[]): {branch: string; filePath: string} { const branch = ambiguousReference[0]; const filePathFromSearch = this.searchParams.getAll('path[]').join('/'); |