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

Function joinBom

packages/core/src/tool/edit.ts:49–49  ·  view source on GitHub ↗
(text: string, bom: boolean)

Source from the content-addressed store, hash-verified

47const splitBom = (text: string) =>
48 text.startsWith("\uFEFF") ? { bom: true, text: text.slice(1) } : { bom: false, text }
49const joinBom = (text: string, bom: boolean) => (bom ? `\uFEFF${text}` : text)
50const decodeUtf8 = (content: Uint8Array) => {
51 const bom = content[0] === 0xef && content[1] === 0xbb && content[2] === 0xbf
52 return { bom, content, text: new TextDecoder().decode(bom ? content.slice(3) : content) }

Callers 1

edit.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected