# core/converters/text.converter.ts

> 11 lines of code and 5 definitions.

Tree: GovLab Context
Language: typescript
Layer: processing
Canonical: https://banes-lab.com/anatomy/context#file-context-core-converters-text-converter-ts
Source text: https://banes-lab.com/source/context/core/converters/text.converter.ts.txt

Listed in [core/converters](https://banes-lab.com/api/source/context/core/converters.md), after [core/converters/identifier.converter.ts](https://banes-lab.com/source/context/core/converters/identifier.converter.ts.md).

## Definitions

- `valueAfter` (lexical_declaration, line 12, exported)
- `splitLines` (lexical_declaration, line 8, exported)
- `LINE_FEED` (lexical_declaration, line 1)
- `CARRIAGE_RETURN` (lexical_declaration, line 2)
- `withoutReturn` (lexical_declaration, line 4)

## Contained in

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

## Used by

- [core/parsers/check.parser.ts](https://banes-lab.com/source/context/core/parsers/check.parser.ts.md)
- [core/parsers/node.parser.ts](https://banes-lab.com/source/context/core/parsers/node.parser.ts.md)
- [core/validators/document.validator.ts](https://banes-lab.com/source/context/core/validators/document.validator.ts.md)

## Linked from

- [core/parsers](https://banes-lab.com/anatomy/context/folder-context-core-parsers.md)
- [core/validators](https://banes-lab.com/anatomy/context/folder-context-core-validators.md)

## Source

```typescript
const LINE_FEED = "\n";
const CARRIAGE_RETURN = "\r";

const withoutReturn = function withoutReturn(line: string): string {
    return line.endsWith(CARRIAGE_RETURN) ? line.slice(0, -1) : line;
};

export const splitLines = function splitLines(text: string): string[] {
    return text.split(LINE_FEED).map(withoutReturn);
};

export const valueAfter = function valueAfter(trimmed: string, prefix: string): string {
    return trimmed.slice(prefix.length).trim();
};
```
