* `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[])
| 338 | * because `const { f } = d` gives the binding `f` no node but `d::f`. |
| 339 | */ |
| 340 | function moduleBindingsFirst(filePath: string, nodes: Node[]): Node[] { |
| 341 | if (!JS_FAMILY_FILE.test(filePath)) return nodes; |
| 342 | const own = nodes.filter((n) => n.qualifiedName === n.name); |
| 343 | return own.length === nodes.length ? nodes : [...own, ...nodes.filter((n) => n.qualifiedName !== n.name)]; |
| 344 | } |
| 345 | |
| 346 | /** The file's nodes named `name`, in `getNodesInFile` order. */ |
| 347 | function nodesInFileNamed(filePath: string, name: string, context: ResolutionContext): Node[] { |
no outgoing calls
no test coverage detected