MCPcopy Create free account
hub / github.com/cloudflare/computer / inferType

Function inferType

packages/computer/src/git/reads.ts:424–428  ·  view source on GitHub ↗
(mode: string)

Source from the content-addressed store, hash-verified

422}
423
424function inferType(mode: string): "blob" | "tree" | "commit" {
425 if (mode.startsWith("04")) return "tree";
426 if (mode === "160000") return "commit";
427 return "blob";
428}
429
430function errorMessage(cause: unknown): string {
431 if (cause instanceof Error) return cause.message;

Callers 1

lsTreeWithFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected