MCPcopy Index your code
hub / github.com/anomalyco/opencode / sanitize

Function sanitize

packages/core/src/npm.ts:45–48  ·  view source on GitHub ↗
(pkg: string)

Source from the content-addressed store, hash-verified

43const illegal = process.platform === "win32" ? new Set(["<", ">", ":", '"', "|", "?", "*"]) : undefined
44
45export function sanitize(pkg: string) {
46 if (!illegal) return pkg
47 return Array.from(pkg, (char) => (illegal.has(char) || char.charCodeAt(0) < 32 ? "_" : char)).join("")
48}
49
50const resolveEntryPoint = (name: string, dir: string): EntryPoint => {
51 let entrypoint: string | undefined

Callers 1

directoryFunction · 0.70

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected