MCPcopy Create free account
hub / github.com/TanStack/ai / mergeUse

Function mergeUse

testing/react-native-smoke/scripts/assert-import-surface.ts:114–129  ·  view source on GitHub ↗
(
  uses: Array<SpecifierUse>,
  specifier: string,
  names: Set<string> | undefined,
)

Source from the content-addressed store, hash-verified

112}
113
114function mergeUse(
115 uses: Array<SpecifierUse>,
116 specifier: string,
117 names: Set<string> | undefined,
118) {
119 const existing = uses.find((use) => use.specifier === specifier)
120 if (!existing) {
121 uses.push({ specifier, ...(names ? { names } : {}) })
122 return
123 }
124 if (!names || !existing.names) {
125 delete existing.names
126 return
127 }
128 for (const name of names) existing.names.add(name)
129}
130
131function importUses(source: string): Array<SpecifierUse> {
132 const parseSource = stripComments(source)

Callers 2

importUsesFunction · 0.85
exportUsesForNamesFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected