parseJsonRows

Reads a JSON response as a header and rows, by Chalk's mapping (spec 4.9, "JSON as rows").

@internote/canvas-sdkFunction
On this page
import { parseJsonRows } from '@internote/canvas-sdk';

The compiler reads the same response by the same rules to check columns, so the two must agree: the columns are the flat keys in first-seen order, normalised as a grid header is; a key that is ever an object or an array is no column at all; a missing key is the empty string. A response that is not JSON, or that reaches no objects, gives no columns: the compiler has already refused it, and a reader never sees an invented table.

#Signature

(text: string, path: string | undefined): CsvRows

#Parameters

text
The response text.
path
The dataset's dotted path:, if written.

Declared in packages/canvas-sdk/src/data/attachments.ts:187.

Last updated