summaryrefslogtreecommitdiff
path: root/source/github-helpers/index.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-11-01 12:24:19 +0800
committerGravatar GitHub <noreply@github.com> 2023-11-01 04:24:19 +0000
commitae6ca57b45b4e4ad201793b8dc7f3535c43de976 (patch)
tree679608ff74b842731d0a1ce8591d2c17dd727010 /source/github-helpers/index.ts
parent4a9e021202ceb76962d08d70ecab2ec9becab8d9 (diff)
downloadrefined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.gz
refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.zst
refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.zip
Meta: Use new `select-dom` API (#6992)
Diffstat (limited to 'source/github-helpers/index.ts')
-rw-r--r--source/github-helpers/index.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/github-helpers/index.ts b/source/github-helpers/index.ts
index b9e4e673..051d4b02 100644
--- a/source/github-helpers/index.ts
+++ b/source/github-helpers/index.ts
@@ -1,4 +1,4 @@
-import select from 'select-dom';
+import {$, elementExists} from 'select-dom';
import onetime from 'onetime';
import elementReady from 'element-ready';
import compareVersions from 'tiny-version-compare';
@@ -37,7 +37,7 @@ export function buildRepoURL<S extends string>(...pathParts: RequireAtLeastOne<A
}
export function getForkedRepo(): string | undefined {
- return select('meta[name="octolytics-dimension-repository_parent_nwo"]')?.content;
+ return $('meta[name="octolytics-dimension-repository_parent_nwo"]')?.content;
}
export function parseTag(tag: string): {version: string; namespace: string} {
@@ -92,7 +92,7 @@ export const isPermalink = mem(async () => {
}
// Awaiting only the branch selector means it resolves early even if the icon tag doesn't exist, whereas awaiting the icon tag would wait for the DOM ready event before resolving.
- return select.exists(
+ return elementExists(
'.octicon-tag', // Tags have an icon
await elementReady(branchSelector),
);
@@ -118,7 +118,7 @@ export async function isArchivedRepoAsync(): Promise<boolean> {
return pageDetect.isArchivedRepo();
}
-export const userCanLikelyMergePR = (): boolean => select.exists('.discussion-sidebar-item .octicon-lock');
+export const userCanLikelyMergePR = (): boolean => elementExists('.discussion-sidebar-item .octicon-lock');
export const cacheByRepo = (): string => getRepo()!.nameWithOwner;