Skip to main content

parseJsonDocument

@forge/monorepo


@forge/monorepo / backend/src / parseJsonDocument

Function: parseJsonDocument()

parseJsonDocument(bytes, limits): ExtractedDocument | ExtractionFailure

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

JSON as a document.

An array of flat objects is a table and is by far the most common shape a JSON attachment has, so it is extracted as one. Anything else is rendered as indented text: still readable, and honest about the fact that there was no table to find.

Parameters

bytes

Uint8Array

limits

ExtractionLimits

Returns

ExtractedDocument | ExtractionFailure