(ast)
| 74 | * @returns {t.ModuleImport[]} - nodes |
| 75 | */ |
| 76 | const getImportedGlobals = (ast) => { |
| 77 | /** @type {t.ModuleImport[]} */ |
| 78 | const importedGlobals = []; |
| 79 | |
| 80 | t.traverse(ast, { |
| 81 | ModuleImport({ node }) { |
| 82 | if (t.isGlobalType(node.descr)) { |
| 83 | importedGlobals.push(node); |
| 84 | } |
| 85 | } |
| 86 | }); |
| 87 | |
| 88 | return importedGlobals; |
| 89 | }; |
| 90 | |
| 91 | /** |
| 92 | * Get the count for imported func |