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

Function sanitizeSurrogates

packages/opencode/src/provider/transform.ts:25–27  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

23const INCLUDE_ENCRYPTED_REASONING = ["reasoning.encrypted_content"] as const
24
25export function sanitizeSurrogates(content: string) {
26 return content.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "\uFFFD")
27}
28
29// Maps npm package to the key the AI SDK expects for providerOptions
30function sdkKey(npm: string): string | undefined {

Callers 2

sanitizeToolResultOutputFunction · 0.85
normalizeMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected