chore: replace deprecated code

pull/4057/head
Chris 1 year ago
parent f0fd3d175c
commit 94216db40f

@ -1,7 +1,7 @@
import { customAlphabet } from 'nanoid' import { customAlphabet } from 'nanoid'
import c from 'picocolors' import c from 'picocolors'
import type { ShikiTransformer } from 'shiki' import type { ShikiTransformer } from 'shiki'
import { bundledLanguages, getHighlighter, isSpecialLang } from 'shiki' import { bundledLanguages, createHighlighter, isSpecialLang } from 'shiki'
import { import {
transformerCompactLineOptions, transformerCompactLineOptions,
transformerNotationDiff, transformerNotationDiff,
@ -57,7 +57,7 @@ export async function highlight(
codeTransformers: userTransformers = [] codeTransformers: userTransformers = []
} = options } = options
const highlighter = await getHighlighter({ const highlighter = await createHighlighter({
themes: themes:
typeof theme === 'object' && 'light' in theme && 'dark' in theme typeof theme === 'object' && 'light' in theme && 'dark' in theme
? [theme.light, theme.dark] ? [theme.light, theme.dark]

Loading…
Cancel
Save