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

Function normalize

packages/core/src/patch.ts:187–193  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

185const trim = (left: string, right: string) => left.trim() === right.trim()
186const normalized = (left: string, right: string) => normalize(left.trim()) === normalize(right.trim())
187const normalize = (value: string) =>
188 value
189 .replace(/[‘’‚‛]/g, "'")
190 .replace(/[“”„‟]/g, '"')
191 .replace(/[‐‑‒–—―]/g, "-")
192 .replace(/…/g, "...")
193 .replace(/ /g, " ")
194const splitBom = (text: string) =>
195 text.startsWith("\uFEFF") ? { bom: true, text: text.slice(1) } : { bom: false, text }
196const stripHeredoc = (input: string) =>

Callers 2

image.tsFile · 0.70
normalizedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected