aboutsummaryrefslogtreecommitdiff
path: root/utils/getFormat.ts
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-12-24 13:03:54 +0700
committerFactiven <[email protected]>2023-12-24 13:03:54 +0700
commit50a0f0240d7fef133eb5acc1bea2b1168b08e9db (patch)
tree307e09e505580415a58d64b5fc3580e9235869f1 /utils/getFormat.ts
parentUpdate README.md (#104) (diff)
downloadmoopa-50a0f0240d7fef133eb5acc1bea2b1168b08e9db.tar.xz
moopa-50a0f0240d7fef133eb5acc1bea2b1168b08e9db.zip
migrate to typescript
Diffstat (limited to 'utils/getFormat.ts')
-rw-r--r--utils/getFormat.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/getFormat.ts b/utils/getFormat.ts
new file mode 100644
index 0000000..7f3eece
--- /dev/null
+++ b/utils/getFormat.ts
@@ -0,0 +1,17 @@
+const data = [
+ { name: "TV Show", value: "TV" },
+ { name: "TV Short", value: "TV_SHORT" },
+ { name: "Movie", value: "MOVIE" },
+ { name: "Special", value: "SPECIAL" },
+ { name: "OVA", value: "OVA" },
+ { name: "ONA", value: "ONA" },
+ { name: "Music", value: "MUSIC" },
+ { name: "Manga", value: "MANGA" },
+ { name: "Novel", value: "NOVEL" },
+ { name: "One Shot", value: "ONE_SHOT" },
+];
+
+export function getFormat(format: string) {
+ const results = data.find((item) => item.value === format);
+ return results?.name;
+}