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

Method readConfiguration

ark/aot/precompile.ts:3954–3985  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3952 }
3953
3954 private readConfiguration() {
3955 if (this.config === undefined) {
3956 return {
3957 module: undefined,
3958 modules: [],
3959 call: undefined,
3960 version: undefined,
3961 files: undefined
3962 }
3963 }
3964 const module = this.graph.moduleOf(this.config)
3965 if (!(module instanceof SourceModule)) {
3966 return throwError(
3967 writeUnreadableConfigMessage(this.graph.pathOf(this.config))
3968 )
3969 }
3970 const modules = this.importClosureOf(module.id)
3971 const call = this.configureCallsOf(module)[0]
3972 return {
3973 module,
3974 modules,
3975 call,
3976 version:
3977 call &&
3978 hashOf(
3979 modules
3980 .map(id => `${this.graph.pathOf(id)}\n${this.sourceOf(id)}`)
3981 .join("\n")
3982 ),
3983 files: call && hashOf(this.filesOf(module.id).join("\n"))
3984 }
3985 }
3986
3987 // a host may give other text than the file's
3988 private filesOf(id: string): string[] {

Callers 2

applyConfigurationMethod · 0.95
needsNewThreadMethod · 0.95

Calls 10

importClosureOfMethod · 0.95
configureCallsOfMethod · 0.95
sourceOfMethod · 0.95
filesOfMethod · 0.95
throwErrorFunction · 0.90
hashOfFunction · 0.90
mapMethod · 0.65
moduleOfMethod · 0.45
pathOfMethod · 0.45

Tested by

no test coverage detected