summaryrefslogtreecommitdiff
path: root/source/libs/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/utils.ts')
-rw-r--r--source/libs/utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/libs/utils.ts b/source/libs/utils.ts
index 9fe914c2..68e23594 100644
--- a/source/libs/utils.ts
+++ b/source/libs/utils.ts
@@ -114,6 +114,10 @@ export function getOP(): string {
return select('.timeline-comment-header-text .author')!.textContent!;
}
+export function compareNames(username: string, realname: string): boolean {
+ return username.replace(/-/g, '').toLowerCase() === realname.normalize('NFD').replace(/[\u0300-\u036f\W.]/g, '').toLowerCase();
+}
+
export async function poll<T>(callback: () => T, frequency: number): Promise<T> {
return new Promise(resolve => {
(function loop() {