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

Function export

ark/schema/scope.ts:622–657  ·  view source on GitHub ↗
(...names: string[])

Source from the content-addressed store, hash-verified

620 } & unknown
621 >
622 export(...names: string[]): SchemaModule {
623 if (!this._exports) {
624 this._exports = {}
625 for (const name of this.exportedNames) {
626 const def = this.aliases[name]
627 this._exports[name] =
628 hasArkKind(def, "module") ?
629 bindModule(def, this)
630 : bootstrapAliasReferences(this.maybeResolve(name)!)
631 }
632
633 // force node.resolution getter evaluation
634 // eslint-disable-next-line @typescript-eslint/no-unused-expressions
635 for (const node of this.lazyResolutions) node.resolution
636
637 this._exportedResolutions = resolutionsOfModule(this, this._exports)
638
639 this._json = resolutionsToJson(this._exportedResolutions)
640 Object.assign(this.resolutions, this._exportedResolutions)
641
642 this.references = Object.values(this.referencesById)
643 if (!this.resolvedConfig.jitless) {
644 const precompiler = precompileReferences(this.references)
645 this.precompilation = precompiler.write(rootScopeFnName, 4)
646 bindPrecompilation(this.references, precompiler, this)
647 }
648 this.resolved = true
649 }
650 const namesToExport = names.length ? names : this.exportedNames
651 return new RootModule(
652 flatMorph(namesToExport, (_, name) => [
653 name,
654 this._exports![name]
655 ]) as never
656 ) as never
657 }
658
659 resolve<name extends exportedNameOf<$>>(
660 name: name

Callers

nothing calls this directly

Calls 9

hasArkKindFunction · 0.90
bindModuleFunction · 0.90
flatMorphFunction · 0.90
bootstrapAliasReferencesFunction · 0.85
resolutionsOfModuleFunction · 0.85
resolutionsToJsonFunction · 0.85
precompileReferencesFunction · 0.85
bindPrecompilationFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…