MCPcopy Create free account
hub / github.com/coder/guts / InjectImport

Function InjectImport

config/imports.go:22–24  ·  view source on GitHub ↗

InjectImport returns a mutation that appends a value-import statement for the given module to the top of the generated output. ts.ApplyMutations(config.InjectImport("zod", "z")) // import { z } from "zod" Repeat calls for the same module are merged by the underlying (*guts.Typescript).AppendImpo

(module string, names ...string)

Source from the content-addressed store, hash-verified

20// config.InjectImport("./schemas", "Foo=Bar")
21// // import { Foo as Bar } from "./schemas"
22func InjectImport(module string, names ...string) guts.MutationFunc {
23 return injectImport(module, false, names...)
24}
25
26// InjectTypeImport returns a mutation that appends a type-only import
27// statement for the given module:

Calls 1

injectImportFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…