# core/reporters/derivation.reporter.ts

> 24 lines of code and 5 definitions.

Tree: Bane's Lab Content
Language: typescript
Layer: operations
Canonical: https://banes-lab.com/anatomy/content#file-content-core-reporters-derivation-reporter-ts
Source text: https://banes-lab.com/source/content/core/reporters/derivation.reporter.ts.txt

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

## Definitions

- `say` (lexical_declaration, line 9, exported)
- `refuse` (lexical_declaration, line 13, exported)
- `conclude` (lexical_declaration, line 18, exported)
- `EXIT_CLEAN` (lexical_declaration, line 6)
- `EXIT_FAILED` (lexical_declaration, line 7)

## Contained in

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

## Used by

- [runtime/entrypoints/leak.entrypoint.ts](https://banes-lab.com/source/content/runtime/entrypoints/leak.entrypoint.ts.md)
- [runtime/entrypoints/link.entrypoint.ts](https://banes-lab.com/source/content/runtime/entrypoints/link.entrypoint.ts.md)

## Linked from

- [core/reporters](https://banes-lab.com/anatomy/content/folder-content-core-reporters.md)
- [runtime/entrypoints](https://banes-lab.com/anatomy/content/folder-content-runtime-entrypoints.md)

## Source

```typescript
import { FINDINGS_HEAD, FINDING_INDENT } from "#configuration/strings/derivation.strings";
import type { Finding } from "#types/derivation.types";
import { LINE_END } from "#configuration/constants/inventory.constants";
import process from "node:process";

const EXIT_CLEAN = 0;
const EXIT_FAILED = 1;

export const say = function say(message: string): void {
    process.stdout.write(message + LINE_END);
};

export const refuse: (message: string) => never = function refuse(message: string): never {
    process.stderr.write(message + LINE_END);
    process.exit(EXIT_FAILED);
};

export const conclude = function conclude(label: string, findings: readonly Finding[], clean: string): void {
    if (findings.length === 0) {
        say(clean);
        process.exit(EXIT_CLEAN);
    }
    say(`${label}: ${String(findings.length)}${FINDINGS_HEAD}`);
    for (const finding of findings) {
        say(`${FINDING_INDENT}${finding.file}  ${finding.message}`);
    }
    process.exit(EXIT_FAILED);
};
```
