MCPcopy Create free account
hub / github.com/anomalyco/opencode / stripHeredoc

Function stripHeredoc

packages/core/src/patch.ts:196–197  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

194const splitBom = (text: string) =>
195 text.startsWith("\uFEFF") ? { bom: true, text: text.slice(1) } : { bom: false, text }
196const stripHeredoc = (input: string) =>
197 input.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/)?.[2] ?? input

Callers 1

parseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected