MCPcopy Index your code
hub / github.com/TanStack/query / findNamespaceImportIdentifier

Function findNamespaceImportIdentifier

packages/query-codemods/src/utils/index.cjs:27–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 packageName = '@tanstack/react-query',
26 ) => {
27 const findNamespaceImportIdentifier = () => {
28 const specifier = root
29 .find(jscodeshift.ImportDeclaration, {
30 source: {
31 value: packageName,
32 },
33 })
34 .find(jscodeshift.ImportNamespaceSpecifier)
35 .paths()
36
37 return specifier.length > 0 ? specifier[0].value.local : null
38 }
39
40 /**
41 * First, we search for the namespace import identifier because if we have any, we assume the consumer uses

Callers 1

locateImportsFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…