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

Function resolutionsOfModule

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

Source from the content-addressed store, hash-verified

1450>
1451
1452const resolutionsOfModule = ($: BaseScope, typeSet: RootExportCache) => {
1453 const result: InternalResolutions = {}
1454 for (const k in typeSet) {
1455 const v = typeSet[k]
1456 if (hasArkKind(v, "module")) {
1457 const innerResolutions = resolutionsOfModule($, v as never)
1458 const prefixedResolutions = flatMorph(
1459 innerResolutions,
1460 (innerK, innerV) => [`${k}.${innerK}`, innerV]
1461 )
1462 Object.assign(result, prefixedResolutions)
1463 } else if (hasArkKind(v, "root") || hasArkKind(v, "generic")) result[k] = v
1464 else throwInternalError(`Unexpected scope resolution ${printable(v)}`)
1465 }
1466 return result
1467}
1468
1469export { writeUnresolvableMessage }
1470

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