( fn: FunctionNode, module: SourceModule )
| 6299 | // the name a module exports a function as, e.g. `createEnv` for |
| 6300 | // `export { createEnv }` or `export const createEnv = opts => ...` |
| 6301 | const exportedFunctionNameOf = ( |
| 6302 | fn: FunctionNode, |
| 6303 | module: SourceModule |
| 6304 | ): string | undefined => { |
| 6305 | for (const name in module.scopes.exportsByName) { |
| 6306 | const entry = module.scopes.exportsByName[name] |
| 6307 | const exported = |
| 6308 | entry.kind === "expression" ? unwrapExpression(entry.node) |
| 6309 | : entry.kind === "binding" ? functionOfBinding(entry.binding, module) |
| 6310 | : undefined |
| 6311 | if (exported === fn) return name |
| 6312 | } |
| 6313 | } |
| 6314 | |
| 6315 | // what a declaration module declares a function's parameters as, e.g. for |
| 6316 | // `declare function f(opts: Options): void`, `declare const f: (opts: |
no test coverage detected