summaryrefslogtreecommitdiff
path: root/source/github-helpers
diff options
context:
space:
mode:
Diffstat (limited to 'source/github-helpers')
-rw-r--r--source/github-helpers/github-url.ts8
-rw-r--r--source/github-helpers/search-query.ts8
2 files changed, 8 insertions, 8 deletions
diff --git a/source/github-helpers/github-url.ts b/source/github-helpers/github-url.ts
index 21f1368e..8c5b1258 100644
--- a/source/github-helpers/github-url.ts
+++ b/source/github-helpers/github-url.ts
@@ -3,13 +3,13 @@ import {getCurrentCommittish} from '.';
export default class GitHubURL {
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792
user: string;
- // @ts-expect-error
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792
repository: string;
- // @ts-expect-error
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792
route: string;
- // @ts-expect-error
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792
branch: string;
- // @ts-expect-error
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/26792
filePath: string;
private internalUrl: URL;
diff --git a/source/github-helpers/search-query.ts b/source/github-helpers/search-query.ts
index d9720d57..eb2ffd5f 100644
--- a/source/github-helpers/search-query.ts
+++ b/source/github-helpers/search-query.ts
@@ -31,6 +31,10 @@ Parser/Mutator of GitHub's search query directly on anchors and URL-like objects
Notice: if the <a> or `location` changes outside SearchQuery, `get()` will return an outdated value.
*/
export default class SearchQuery {
+ static escapeValue(value: string): string {
+ return value.includes(' ') ? `"${value}"` : value;
+ }
+
link?: HTMLAnchorElement;
searchParams: URLSearchParams;
@@ -54,10 +58,6 @@ export default class SearchQuery {
this.set(this.get());
}
- static escapeValue(value: string): string {
- return value.includes(' ') ? `"${value}"` : value;
- }
-
get(): string {
const currentQuery = this.searchParams.get('q');
if (typeof currentQuery === 'string') {