MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / VariableDeclarator

Function VariableDeclarator

packages/vite/hmr/helpers/ast-normalizer.ts:305–321  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

303 }
304 },
305 VariableDeclarator(path) {
306 const id = path.node.id;
307 if (t.isIdentifier(id)) {
308 declared.add(id.name);
309 } else if (t.isObjectPattern(id)) {
310 for (const prop of id.properties) {
311 if (t.isObjectProperty(prop)) {
312 const val: any = prop.value as any;
313 if (t.isIdentifier(val)) declared.add(val.name);
314 else if (t.isAssignmentPattern(val) && t.isIdentifier(val.left)) declared.add(val.left.name);
315 } else if (t.isRestElement(prop)) {
316 const arg: any = prop.argument as any;
317 if (t.isIdentifier(arg)) declared.add(arg.name);
318 }
319 }
320 }
321 },
322 FunctionDeclaration(path) {
323 if (path.node.id?.name) declared.add(path.node.id.name);
324 },

Callers

nothing calls this directly

Calls 5

addMethod · 0.65
StringClass · 0.50
testMethod · 0.45
filterMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected