MCPcopy
hub / github.com/ampproject/amphtml / ImportDeclaration

Function ImportDeclaration

build-system/eslint-rules/no-duplicate-import.js:73–94  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

71 },
72
73 ImportDeclaration(node) {
74 const {specifiers} = node;
75 const source = node.source.value;
76
77 if (specifiers.length === 0) {
78 return;
79 }
80 for (let i = 0; i < specifiers.length; i++) {
81 if (specifiers[i].type === 'ImportNamespaceSpecifier') {
82 return;
83 }
84 }
85
86 const imports = getImportMap(node);
87 let nodes = imports.get(source);
88 if (!nodes) {
89 nodes = [];
90 imports.set(source, nodes);
91 }
92
93 nodes.push(node);
94 },
95 };
96 },
97};

Callers

nothing calls this directly

Calls 4

getImportMapFunction · 0.85
getMethod · 0.45
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected