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

Method keep

ark/aot/flat.ts:784–793  ·  view source on GitHub ↗
(module: SourceModule, statement: Node)

Source from the content-addressed store, hash-verified

782 }
783
784 keep(module: SourceModule, statement: Node): void {
785 if (this.statements.has(statement)) return
786 this.statements.add(statement)
787 const skipped = this.skipped.get(module) ?? []
788 for (const reference of this.referencesOf(module).get(statement) ?? []) {
789 const { start } = reference.id
790 if (!skipped.some(span => span.start <= start && start < span.end))
791 this.keepBinding(module, reference.binding)
792 }
793 }
794
795 reads(binding: Binding | undefined): boolean {
796 return !!binding && this.imports.has(binding)

Callers 3

keepReadMethod · 0.95
keepExportMethod · 0.95
keepBindingMethod · 0.95

Calls 5

referencesOfMethod · 0.95
keepBindingMethod · 0.95
getMethod · 0.65
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected