MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / parseOptions

Function parseOptions

frontend/app/element/markdown-util.ts:23–37  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

21}
22
23function parseOptions(str: string): Record<string, any> {
24 const trimmed = str.trim();
25 if (!trimmed) return null;
26
27 try {
28 const parsed = JSON.parse(trimmed);
29 // Ensure it's an object (not array or primitive)
30 if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
31 return null;
32 }
33 return parsed;
34 } catch {
35 return null;
36 }
37}
38
39function makeMarkdownWaveBlockKey(block: MarkdownContentBlockType): string {
40 return `${block.type}[${block.id}]`;

Callers 1

transformBlocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected