MCPcopy Create free account
hub / github.com/TanStack/query / isClassInstantiationOf

Function isClassInstantiationOf

packages/query-codemods/src/utils/index.cjs:156–168  ·  view source on GitHub ↗
(node, selector)

Source from the content-addressed store, hash-verified

154 }
155
156 const isClassInstantiationOf = (node, selector) => {
157 if (!isNewExpression(node)) {
158 return false
159 }
160
161 const parts = selector.split('.')
162
163 return parts.length === 1
164 ? isIdentifier(node.callee) && node.callee.name === parts[0]
165 : isMemberExpression(node.callee) &&
166 node.callee.object.name === parts[0] &&
167 node.callee.property.name === parts[1]
168 }
169
170 const isFunctionCallOf = (node, selector) => {
171 if (!isCallExpression(node)) {

Callers 1

Calls 3

isNewExpressionFunction · 0.85
isMemberExpressionFunction · 0.85
isIdentifierFunction · 0.70

Tested by

no test coverage detected