summaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-07-15 20:45:32 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-07-15 20:45:32 +0900
commitdc69490e3abdebf186e9b642c629ec888afc88d8 (patch)
tree8b95a41a95083cdc4009f581a02c6a11c0f4279f /src/misc
parentImprove email notification (diff)
downloadmisskey-dc69490e3abdebf186e9b642c629ec888afc88d8.tar.gz
misskey-dc69490e3abdebf186e9b642c629ec888afc88d8.tar.bz2
misskey-dc69490e3abdebf186e9b642c629ec888afc88d8.zip
Refactoring
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/acct.ts14
-rw-r--r--src/misc/acct/parse.ts7
-rw-r--r--src/misc/acct/render.ts5
-rw-r--r--src/misc/acct/type.ts6
4 files changed, 14 insertions, 18 deletions
diff --git a/src/misc/acct.ts b/src/misc/acct.ts
new file mode 100644
index 0000000000..16876c4429
--- /dev/null
+++ b/src/misc/acct.ts
@@ -0,0 +1,14 @@
+export type Acct = {
+ username: string;
+ host: string | null;
+};
+
+export const getAcct = (user: Acct) => {
+ return user.host == null ? user.username : `${user.username}@${user.host}`;
+};
+
+export const parseAcct = (acct: string): Acct => {
+ if (acct.startsWith('@')) acct = acct.substr(1);
+ const split = acct.split('@', 2);
+ return { username: split[0], host: split[1] || null };
+};
diff --git a/src/misc/acct/parse.ts b/src/misc/acct/parse.ts
deleted file mode 100644
index e3bed35d8e..0000000000
--- a/src/misc/acct/parse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import Acct from './type';
-
-export default (acct: string): Acct => {
- if (acct.startsWith('@')) acct = acct.substr(1);
- const split = acct.split('@', 2);
- return { username: split[0], host: split[1] || null };
-};
diff --git a/src/misc/acct/render.ts b/src/misc/acct/render.ts
deleted file mode 100644
index 094eceffe9..0000000000
--- a/src/misc/acct/render.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import Acct from './type';
-
-export default (user: Acct) => {
- return user.host == null ? user.username : `${user.username}@${user.host}`;
-};
diff --git a/src/misc/acct/type.ts b/src/misc/acct/type.ts
deleted file mode 100644
index 7f31257400..0000000000
--- a/src/misc/acct/type.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-type Acct = {
- username: string;
- host: string | null;
-};
-
-export default Acct;