# core/selectors/program.selector.ts

> 13 lines of code and 2 definitions.

Tree: GovLab Docs
Language: typescript
Layer: application
Canonical: https://banes-lab.com/anatomy/docs#file-docs-core-selectors-program-selector-ts
Source text: https://banes-lab.com/source/docs/core/selectors/program.selector.ts.txt

Listed in [core/selectors](https://banes-lab.com/api/source/docs/core/selectors.md), after [core/selectors/metadata.selector.ts](https://banes-lab.com/source/docs/core/selectors/metadata.selector.ts.md) and before [core/selectors/record.selector.ts](https://banes-lab.com/source/docs/core/selectors/record.selector.ts.md).

## Definitions

- `inPackageSources` (lexical_declaration, line 5, exported)
- `DECLARATION_SUFFIX` (lexical_declaration, line 3)

## Contained in

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

## Used by

- [core/analyzers/orchestration.analyzer.ts](https://banes-lab.com/source/docs/core/analyzers/orchestration.analyzer.ts.md)

## Linked from

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

## Source

```typescript
import type ts from "typescript";

const DECLARATION_SUFFIX = ".d.ts";

export const inPackageSources = function inPackageSources(
    program: ts.Program,
    dirPosix: string,
): readonly ts.SourceFile[] {
    return program
        .getSourceFiles()
        .filter(
            (file) =>
                !file.fileName.endsWith(DECLARATION_SUFFIX) && file.fileName.split("\\").join("/").startsWith(dirPosix),
        );
};
```
