diff options
author | 2020-06-16 19:56:43 +0200 | |
---|---|---|
committer | 2020-06-16 19:56:43 +0200 | |
commit | a918f9a3eb6827dd67efdd1bcf362df2e7152406 (patch) | |
tree | 4aeb0966e89ed9a641f519f8934a959a868a8823 /source/github-helpers/github-url.ts | |
parent | 1d003c988da53f575b0285f8366ada9b80b76510 (diff) | |
download | refined-github-a918f9a3eb6827dd67efdd1bcf362df2e7152406.tar.gz refined-github-a918f9a3eb6827dd67efdd1bcf362df2e7152406.tar.zst refined-github-a918f9a3eb6827dd67efdd1bcf362df2e7152406.zip |
Meta: Minor improvements and lint (#3231)
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('/'); |