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

Function typeCacheKeyOf

ark/aot/graph.ts:6642–6660  ·  view source on GitHub ↗
(
	depth: number,
	params: readonly TSTypeParameter[] | undefined,
	boundArgs: TypeArgs | undefined
)

Source from the content-addressed store, hash-verified

6640 declaration.parent.parent?.type === "Program")
6641
6642const typeCacheKeyOf = (
6643 depth: number,
6644 params: readonly TSTypeParameter[] | undefined,
6645 boundArgs: TypeArgs | undefined
6646): string => {
6647 const clamped = depth < 2 ? depth : 2
6648 if (!params?.length) return String(clamped)
6649 let key = `${clamped}|`
6650 for (let i = 0; i < params.length; i++) {
6651 if (i) key += ","
6652 const param = params[i]
6653 if (!boundArgs?.has(param)) key += "-"
6654 else {
6655 const val = boundArgs.get(param)
6656 key += val === undefined ? "u" : val
6657 }
6658 }
6659 return key
6660}
6661
6662type PropTypeEntry = {
6663 type: TSType | TSMethodSignature

Callers 1

declaredTypeKindOfMethod · 0.85

Calls 3

StringInterface · 0.85
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected