Download packages/session-ui/src/components/markdown-projection.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/session-ui/src/components/markdown-projection.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/session-ui/src/components/markdown-projection.ts
-
curl -L -o markdown-projection.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/session-ui/src/components/markdown-projection.ts
484 Bytes
| import type { Block, Projection } from "./markdown-stream" | |
| export function completedProjection(text: string): Projection { | |
| return { text, blocks: [{ raw: text, src: text, mode: "full" }] } | |
| } | |
| export function canReusePendingBlock(current: Pick<Block, "mode" | "raw"> | undefined, next: Block) { | |
| if (!current || current.mode !== next.mode) return false | |
| if (next.mode === "code" || next.mode === "live") return next.raw.startsWith(current.raw) | |
| return current.raw === next.raw | |
| } | |