# core/converters/field.converter.ts

> 3 lines of code and 1 definition.

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

Listed in [core/converters](https://banes-lab.com/api/source/patterns/core/converters.md), after [core/converters/definition.converter.ts](https://banes-lab.com/source/patterns/core/converters/definition.converter.ts.md) and before [core/converters/finding.converter.ts](https://banes-lab.com/source/patterns/core/converters/finding.converter.ts.md).

## Definitions

- `asText` (lexical_declaration, line 1, exported)

## Contained in

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

## Used by

- [core/aggregators/representation.distribution.aggregator.ts](https://banes-lab.com/source/patterns/core/aggregators/representation.distribution.aggregator.ts.md)
- [core/aggregators/representation.sequence.aggregator.ts](https://banes-lab.com/source/patterns/core/aggregators/representation.sequence.aggregator.ts.md)

## Linked from

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

## Source

```typescript
export const asText = function asText(value: unknown): string {
    return value !== null && typeof value === "object" ? JSON.stringify(value) : String(value);
};
```
