# core/classifiers/source.classifier.ts

> 8 lines of code and 2 definitions.

Tree: GovLab Stats
Language: typescript
Layer: application
Canonical: https://banes-lab.com/anatomy/stats#file-stats-core-classifiers-source-classifier-ts
Source text: https://banes-lab.com/source/stats/core/classifiers/source.classifier.ts.txt

Listed in [core/classifiers](https://banes-lab.com/api/source/stats/core/classifiers.md).

## Definitions

- `isAuthoredRole` (lexical_declaration, line 8, exported)
- `roleOf` (lexical_declaration, line 4, exported)

## Contained in

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

## Used by

- [core/analyzers/site.analyzer.ts](https://banes-lab.com/source/stats/core/analyzers/site.analyzer.ts.md)
- [core/analyzers/source.analyzer.ts](https://banes-lab.com/source/stats/core/analyzers/source.analyzer.ts.md)
- [core/analyzers/taxonomy.analyzer.ts](https://banes-lab.com/source/stats/core/analyzers/taxonomy.analyzer.ts.md)

## Linked from

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

## Source

```typescript
import { AUTHORED_ROLES, ROLE_BY_EXT } from "#configuration/constants/source.constants";
import type { FileRole } from "#types/source.types";

export const roleOf = function roleOf(ext: string): FileRole {
    return ROLE_BY_EXT.get(ext) ?? "other";
};

export const isAuthoredRole = function isAuthoredRole(role: FileRole): boolean {
    return AUTHORED_ROLES.includes(role);
};
```
