* `nodes` with the members of something else in their JS/TS file (an * object's method `d::f`) moved behind the module's own bindings. Extraction * marks such a member exported, so it can share a name with what an import, * export clause or default export means (#2945); it stays the last answer
(filePath: string, nodes: Node[])
| 322 | * because `const { f } = d` gives the binding `f` no node but `d::f`. |
| 323 | */ |
| 324 | function moduleBindingsFirst(filePath: string, nodes: Node[]): Node[] { |
| 325 | if (!JS_FAMILY_FILE.test(filePath)) return nodes; |
| 326 | const own = nodes.filter((n) => n.qualifiedName === n.name); |
| 327 | return own.length === nodes.length ? nodes : [...own, ...nodes.filter((n) => n.qualifiedName !== n.name)]; |
| 328 | } |
| 329 | |
| 330 | /** The file's nodes named `name`, in `getNodesInFile` order. */ |
| 331 | function nodesInFileNamed(filePath: string, name: string, context: ResolutionContext): Node[] { |
no outgoing calls
no test coverage detected