Skip to main content

TEXT_MEDIA_TYPES

@forge/monorepo


@forge/monorepo / backend/src / TEXT_MEDIA_TYPES

Variable: TEXT_MEDIA_TYPES

const TEXT_MEDIA_TYPES: readonly ["text/plain", "text/markdown", "text/x-markdown", "text/csv", "text/tab-separated-values", "application/json"]

Defined in: backend/src/documents/parsers/text.ts:375

The parser for every text-shaped type.

One parser dispatching on the type it was handed, rather than five parsers sharing a builder. The formats differ only in how a line is read; the bounds, the decoding and the block shapes are identical, and five copies of those is five chances for one to be wrong.