aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/shikiCodeblocks/utils/misc.ts
diff options
context:
space:
mode:
authorJustice Almanzar <superdash993@gmail.com>2023-01-13 17:15:45 -0500
committerGitHub <noreply@github.com>2023-01-13 23:15:45 +0100
commitea748dfb605386b80a4919183ad6fa9249a82e21 (patch)
tree8660c5d192ac553e7574d6b510e18f99c7ac5ddd /src/plugins/shikiCodeblocks/utils/misc.ts
parent6c5fcc4119d05389bbc71bd3e52090f6fd29b10c (diff)
downloadVencord-ea748dfb605386b80a4919183ad6fa9249a82e21.tar.gz
Vencord-ea748dfb605386b80a4919183ad6fa9249a82e21.tar.bz2
Vencord-ea748dfb605386b80a4919183ad6fa9249a82e21.zip
feat: Typesafe Settings Definitions (#403)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/shikiCodeblocks/utils/misc.ts')
-rw-r--r--src/plugins/shikiCodeblocks/utils/misc.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/shikiCodeblocks/utils/misc.ts b/src/plugins/shikiCodeblocks/utils/misc.ts
index fefe938..e0c5263 100644
--- a/src/plugins/shikiCodeblocks/utils/misc.ts
+++ b/src/plugins/shikiCodeblocks/utils/misc.ts
@@ -21,7 +21,7 @@ import { hljs } from "@webpack/common";
import { resolveLang } from "../api/languages";
import { HighlighterProps } from "../components/Highlighter";
-import { HljsSetting, ShikiSettings } from "../types";
+import { HljsSetting } from "../types";
export const cl = classNameFactory("shiki-");
@@ -30,7 +30,7 @@ export const shouldUseHljs = ({
tryHljs,
}: {
lang: HighlighterProps["lang"],
- tryHljs: ShikiSettings["tryHljs"],
+ tryHljs: HljsSetting,
}) => {
const hljsLang = lang ? hljs?.getLanguage?.(lang) : null;
const shikiLang = lang ? resolveLang(lang) : null;
@@ -45,7 +45,6 @@ export const shouldUseHljs = ({
return !langName && !!hljsLang;
case HljsSetting.Never:
return false;
+ default: return false;
}
-
- return false;
};