Skip to content

Commit cac50ab

Browse files
committed
Improve assertions
1 parent 78dd034 commit cac50ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/prism-react-renderer/src/components/useGetLineProps.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ export const useGetLineProps = (themeDictionary?: ThemeDict) =>
1111
className: clsx("token-line", className),
1212
}
1313

14-
if (themeDictionary) output.style = themeDictionary.plain
15-
if (style) output.style = { ...(output.style || {}), ...style }
14+
if (typeof themeDictionary === "object" && "plain" in themeDictionary)
15+
output.style = themeDictionary.plain
16+
17+
if (typeof style === "object")
18+
output.style = { ...(output.style || {}), ...style }
1619

1720
return output
1821
},

0 commit comments

Comments
 (0)