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

Function splitBom

packages/core/src/tool/edit.ts:47–48  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

45 ending === "\n" ? normalizeLineEndings(text) : normalizeLineEndings(text).replaceAll("\n", "\r\n")
46
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

Callers 1

edit.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected