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

Function maybeResolve

ark/schema/scope.ts:703–717  ·  view source on GitHub ↗
(
		name: string
	)

Source from the content-addressed store, hash-verified

701 }
702
703 maybeResolve(
704 name: string
705 ): Exclude<CachedResolution, BaseParseContext> | undefined {
706 const cached = this.res[name]
707 if (cached && !hasArkKind(cached, "context")) {
708 $ark.reached?.cached(this.res, name)
709 if (hasArkKind(cached, "root") && cached.topAlias)
710 return this.resolvePending(name, cached)
711 return this.bindRef(cached)
712 }
713 const mark = $ark.reached?.mark()
714 const resolution = this.resolveUncached(name, cached, mark)
715 $ark.reached?.store(mark, this.res, name)
716 return resolution
717 }
718
719 // resolves the context of an alias's definition, by the phase a reference finds it in
720 private resolveDefinition(

Callers

nothing calls this directly

Calls 3

hasArkKindFunction · 0.90
markMethod · 0.80
storeMethod · 0.80

Tested by

no test coverage detected