# core/validators/chapter.validator.ts

> 13 lines of code and 4 definitions.

Tree: Build tree
Language: typescript
Layer: processing
Canonical: https://banes-lab.com/anatomy/build#file-build-core-validators-chapter-validator-ts
Source text: https://banes-lab.com/assets/sources/source.1313bd74290cc296131b327778fb2697241196471ac455d61135a3b3d79f272a.generated.txt

## Definitions

- `differs` (lexical_declaration, line 3)
- `unstableChapters` (lexical_declaration, line 7, exported)
- `first` (lexical_declaration, line 12, exported)
- `second` (lexical_declaration, line 13, exported)

## Source

```typescript
import type { Attribution, Chapter, ShapeInput, ShapeRenderer } from "#types/chapter.types";

const differs = function differs(first: Chapter, second: Chapter | undefined): boolean {
    return first.body !== second?.body || first.file !== second.file;
};

export const unstableChapters = function unstableChapters(
    render: ShapeRenderer,
    input: ShapeInput,
    attribution: Attribution,
): string[] {
    const first = render(input, attribution);
    const second = render(input, attribution);
    return first.filter((chapter, index) => differs(chapter, second[index])).map((chapter) => chapter.file);
};
```
