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

Function maybeResolveReference

ark/type/parser/string.ts:57–69  ·  view source on GitHub ↗
(
	name: string,
	ctx: BaseParseContext
)

Source from the content-addressed store, hash-verified

55// if a parameter shares its name. Left to an expression, that name would
56// resolve to the parameter
57const maybeResolveReference = (
58 name: string,
59 ctx: BaseParseContext
60): BaseRoot | undefined => {
61 if (isArg(name, ctx)) return
62 const resolution = ctx.$.maybeResolve(name)
63 if (hasArkKind(resolution, "generic")) {
64 return throwParseError(
65 writeInvalidGenericArgCountMessage(name, resolution.names, [])
66 )
67 }
68 return resolution
69}
70
71export const parseString = (
72 def: string,

Callers 1

parseStringFunction · 0.85

Calls 4

hasArkKindFunction · 0.90
throwParseErrorFunction · 0.90
isArgFunction · 0.85

Tested by

no test coverage detected