Skip to main content

Function.csvSourceStructure

function csvSourceStructure(headers: readonly (string | null | undefined)[]):
| {
columns: string[];
format: "csv";
}
| {
format: "json";
paths: string[];
}
| null;

Canonical structure of a CSV header row, or null when the row cannot identify a structure (no columns, or any header empty/unusable once normalized — typically a headerless file).

Parameters

ParameterType
headersreadonly (string

Returns

| { columns: string[]; format: "csv"; } | { format: "json"; paths: string[]; } | null