Skip to content

Commit

Permalink
fix: Leverage twoslasher singleton to avoid OOM (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaine-arcjet authored Dec 5, 2024
1 parent a619a78 commit b261997
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/DisplayType.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
import { createTwoslasher} from "twoslash"
import { format } from "prettier";
import { Code } from "@astrojs/starlight/components";
const twoslasher = createTwoslasher();
import twoslasher from "@/lib/twoslasher";
const generics = Array.isArray(Astro.props.generics) && Astro.props.generics.length > 0
? `<${Astro.props.generics.join(", ")}>`
Expand Down
5 changes: 5 additions & 0 deletions src/lib/twoslasher.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createTwoslasher} from "twoslash"

const twoslasher = createTwoslasher();

export default twoslasher;

0 comments on commit b261997

Please sign in to comment.