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

Function normalizeUnicode

packages/opencode/src/patch/index.ts:418–425  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

416
417// Normalize Unicode punctuation to ASCII equivalents (like Rust's normalize_unicode)
418function normalizeUnicode(str: string): string {
419 return str
420 .replace(/[‘’‚‛]/g, "'") // single quotes
421 .replace(/[“”„‟]/g, '"') // double quotes
422 .replace(/[‐‑‒–—―]/g, "-") // dashes
423 .replace(/…/g, "...") // ellipsis
424 .replace(/ /g, " ") // non-breaking space
425}
426
427type Comparator = (a: string, b: string) => boolean
428

Callers 1

seekSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected