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

Function toolFiletype

packages/opencode/src/cli/cmd/run/tool.ts:1474–1486  ·  view source on GitHub ↗
(input?: string)

Source from the content-addressed store, hash-verified

1472}
1473
1474export function toolFiletype(input?: string): string | undefined {
1475 if (!input) {
1476 return undefined
1477 }
1478
1479 const ext = path.extname(input)
1480 const lang = LANGUAGE_EXTENSIONS[ext]
1481 if (["typescriptreact", "javascriptreact", "javascript"].includes(lang)) {
1482 return "typescript"
1483 }
1484
1485 return lang
1486}

Callers 2

RunPermissionBodyFunction · 0.90
RunEntryContentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected