From 00876d0fbdf8aae6ebe51e38620a436cd98145f2 Mon Sep 17 00:00:00 2001 From: ONLY-yours <1349021570@qq.com> Date: Tue, 31 Oct 2023 16:43:07 +0800 Subject: [PATCH] :sparkles: feat: change options create function --- src/Highlight/wrapper.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Highlight/wrapper.tsx b/src/Highlight/wrapper.tsx index 0a69be90..753510e3 100644 --- a/src/Highlight/wrapper.tsx +++ b/src/Highlight/wrapper.tsx @@ -20,16 +20,10 @@ export interface HighlighterWrapperProps extends DivProps { */ language: string; } - -const options: SelectProps['options'] = []; - -Object.entries(languageMap).forEach(([key, value]) => { - console.log(key, value); - options.push({ - label: key, - value: key.toLowerCase(), - }); -}); +const options: SelectProps['options'] = Object.keys(languageMap).map((key) => ({ + label: key, + value: key.toLowerCase(), +})); export const FullFeatureWrapper = memo((props) => { const {