# core/analyzers/location.analyzer.ts

> 16 lines of code and 3 definitions.

Tree: GovLab Docs
Language: typescript
Layer: processing
Canonical: https://banes-lab.com/anatomy/docs#file-docs-core-analyzers-location-analyzer-ts
Source text: https://banes-lab.com/source/docs/core/analyzers/location.analyzer.ts.txt

Listed in [core/analyzers](https://banes-lab.com/api/source/docs/core/analyzers.md), after [core/analyzers/invocation.analyzer.ts](https://banes-lab.com/source/docs/core/analyzers/invocation.analyzer.ts.md) and before [core/analyzers/machine.analyzer.ts](https://banes-lab.com/source/docs/core/analyzers/machine.analyzer.ts.md).

## Definitions

- `collidePaths` (lexical_declaration, line 4, exported)
- `byPath` (lexical_declaration, line 9, exported)
- `result` (lexical_declaration, line 11, exported)

## Contained in

- [core/analyzers](https://banes-lab.com/anatomy/docs/folder-docs-core-analyzers.md)

## Source

```typescript
import type { Collision, DocEntry, DocRegistries, LocationOptions } from "#types/location.types";
import { computeLocation } from "#core/resolvers/location.resolver";

export const collidePaths = function collidePaths(
    entries: readonly DocEntry[],
    registries: DocRegistries,
    options: LocationOptions = {},
): Collision[] {
    const byPath = new Map<string, string[]>();
    for (const entry of entries) {
        const result = computeLocation({ ...entry, options, registries });
        if (result.ok) {
            byPath.set(result.path, [...(byPath.get(result.path) ?? []), entry.source]);
        }
    }
    return [...byPath].filter(([, sources]) => sources.length > 1).map(([path, sources]) => ({ path, sources }));
};
```
