MCPcopy
hub / github.com/thesysdev/openui / preprocess

Function preprocess

packages/lang-core/src/parser/parser.ts:395–397  ·  view source on GitHub ↗

Clean LLM response: strip fences, comments, whitespace.

(input: string)

Source from the content-addressed store, hash-verified

393
394/** Clean LLM response: strip fences, comments, whitespace. */
395function preprocess(input: string): string {
396 return stripComments(stripFences(input.trim())).trim();
397}
398
399/**
400 * Parse a complete openui-lang string in one pass.

Callers 2

parseFunction · 0.85
refreshCleanedFunction · 0.85

Calls 2

stripCommentsFunction · 0.85
stripFencesFunction · 0.85

Tested by

no test coverage detected