# core/normalizers/readme.normalizer.ts

> 28 lines of code and 7 definitions.

Tree: Build tree
Language: typescript
Layer: processing
Canonical: https://banes-lab.com/anatomy/build#file-build-core-normalizers-readme-normalizer-ts
Source text: https://banes-lab.com/assets/sources/source.dc8b137927cb13457b12b5a5afc27740c06f4ba0c36bf6a5219bbb0eb4e250ea.generated.txt

## Definitions

- `isRepositoryPage` (lexical_declaration, line 12, exported)
- `pageFolderOf` (lexical_declaration, line 16, exported)
- `anchorOf` (lexical_declaration, line 20, exported)
- `out` (lexical_declaration, line 21, exported)
- `kept` (lexical_declaration, line 23, exported)
- `firstSentenceOf` (lexical_declaration, line 29, exported)
- `stop` (lexical_declaration, line 30, exported)

## Used by

- [core/renderers/chapter.renderer.ts](https://banes-lab.com/source/build/core/renderers/chapter.renderer.ts.md)
- [core/renderers/readme.renderer.ts](https://banes-lab.com/source/build/core/renderers/readme.renderer.ts.md)

## Source

```typescript
import {
    ANCHOR_MARK,
    ANCHOR_SPACE,
    LETTERS_AND_DIGITS,
    REPOSITORY_PAGES,
    SENTENCE_STOP,
    SPACE,
} from "#configuration/constants/readme.constants";
import { METHODOLOGY_PAGE } from "@banes-lab/web/core/ids/page.ids.ts";
import { WORD_SEPARATOR } from "#configuration/constants/chapter.constants";

export const isRepositoryPage = function isRepositoryPage(page: string): boolean {
    return REPOSITORY_PAGES.includes(page);
};

export const pageFolderOf = function pageFolderOf(page: string, label: string): string {
    return page === METHODOLOGY_PAGE ? "" : label.toLowerCase().split(SPACE).join(WORD_SEPARATOR);
};

export const anchorOf = function anchorOf(title: string): string {
    let out = "";
    for (const char of title.toLowerCase()) {
        const kept = LETTERS_AND_DIGITS.includes(char) || char === ANCHOR_SPACE;
        out += kept ? char : (char === SPACE ? ANCHOR_SPACE : "");
    }
    return ANCHOR_MARK + out;
};

export const firstSentenceOf = function firstSentenceOf(text: string): string {
    const stop = text.indexOf(SENTENCE_STOP);
    return stop === -1 ? text : text.slice(0, stop + SENTENCE_STOP.trimEnd().length);
};
```
