MCPcopy
hub / github.com/arktypeio/arktype / resolutionsOfModule

Function resolutionsOfModule

ark/schema/scope.ts:853–868  ·  view source on GitHub ↗
($: BaseScope, typeSet: RootExportCache)

Source from the content-addressed store, hash-verified

851>
852
853const resolutionsOfModule = ($: BaseScope, typeSet: RootExportCache) => {
854 const result: InternalResolutions = {}
855 for (const k in typeSet) {
856 const v = typeSet[k]
857 if (hasArkKind(v, "module")) {
858 const innerResolutions = resolutionsOfModule($, v as never)
859 const prefixedResolutions = flatMorph(
860 innerResolutions,
861 (innerK, innerV) => [`${k}.${innerK}`, innerV]
862 )
863 Object.assign(result, prefixedResolutions)
864 } else if (hasArkKind(v, "root") || hasArkKind(v, "generic")) result[k] = v
865 else throwInternalError(`Unexpected scope resolution ${printable(v)}`)
866 }
867 return result
868}
869
870export const writeUnresolvableMessage = <token extends string>(
871 token: token

Callers 1

exportFunction · 0.85

Calls 4

hasArkKindFunction · 0.90
flatMorphFunction · 0.90
throwInternalErrorFunction · 0.90
printableFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…