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

Method add

ark/aot/usage.ts:208–225  ·  view source on GitHub ↗
(specifier: string, edge: ImportEdge)

Source from the content-addressed store, hash-verified

206 private link(runtime: RuntimeModule): void {
207 const { module } = runtime
208 const add = (specifier: string, edge: ImportEdge) => {
209 // e.g. `export * as ark from "arktype"`, whose errors class is read unfollowed
210 if (
211 (edge.kind === "whole" || edge.kind === "star") &&
212 isArkSpecifier(specifier)
213 ) {
214 this.used.add("errors")
215 this.used.add("thrown")
216 }
217 const id = this.program.resolve(specifier, module.id)
218 if (id === undefined || !this.program.modules.has(id)) {
219 if (!isArkSpecifier(specifier)) this.used.add("external")
220 return
221 }
222 const edges = this.edgesByTarget.get(id)
223 if (edges) edges.push(edge)
224 else this.edgesByTarget.set(id, [edge])
225 }
226 const noteExternal = (specifier: string) => {
227 if (isArkSpecifier(specifier)) return
228 const id = this.program.resolve(specifier, module.id)

Callers 15

noteExternalMethod · 0.45
linkMethod · 0.45
readArkExportMethod · 0.45
readArkImportMethod · 0.45
readResultMethod · 0.45
readErrorsMethod · 0.45
readBindingMethod · 0.45
readExportMethod · 0.45
readMethod · 0.45
readArgumentsMethod · 0.45
constantKeyOfFunction · 0.45
buildThisReadsContextFunction · 0.45

Calls 6

isArkSpecifierFunction · 0.85
resolveMethod · 0.65
getMethod · 0.65
hasMethod · 0.45
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected