Something went wrong. Try again.
silly solutions for silly problems tylur.dev/type-level-leetcode
Something went wrong. Try again.
432 B · 16 lines
Astro
1234567891011121314151617---type Props = { name: string;};
import { readFile } from "node:fs/promises";import { Editor } from "./Editor";
const { name } = Astro.props;
const fileText = await readFile(`${process.cwd()}/problems/${name}.ts`);
const dtsFileText = (await readFile(`${process.cwd()}/node_modules/flat-type-samurai/dist/index.d.ts`)).toString();---
<Editor client:only="react" startValue={fileText.toString()} dtsFile={dtsFileText} />