MCPcopy Create free account
hub / github.com/arktypeio/arktype / describeType

Function describeType

ark/attest/cli/trace.ts:103–114  ·  view source on GitHub ↗
(node: ts.Node)

Source from the content-addressed store, hash-verified

101 : nearestBoundingCallExpressionTs5(node, position)
102
103const describeType = (node: ts.Node): { name: string; id: string } => {
104 if (isTs7) {
105 const { type, string } = stringifyTypeAtLocation(node as never)
106 return { name: string, id: `${type.id}` }
107 }
108 const type = getStringifiableType(node)
109 const name = type.toString()
110 return {
111 name,
112 id: `${(type as { id?: number }).id ?? name.substring(0, 20)}`
113 }
114}
115
116interface AnalysisContext {
117 traceDir: string

Callers 1

processDurationEntryFunction · 0.85

Calls 3

stringifyTypeAtLocationFunction · 0.90
getStringifiableTypeFunction · 0.90
toStringMethod · 0.65

Tested by

no test coverage detected