MCPcopy Create free account
hub / github.com/ascorbic/astro-loaders / CSVLoaderOptions

Interface CSVLoaderOptions

packages/csv/src/csv-loader.ts:9–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import { AstroError } from "astro/errors";
8
9export interface CSVLoaderOptions {
10 /** Path to the CSV file */
11 fileName: string;
12 /**
13 * Define how the header values should be transformed into field names.
14 * By default the values are camelized. Pass `false` to leave unchanged.
15 * Pass a function to transform the header values yourself.
16 */
17 transformHeader?: false | ((header: string, index: number) => string);
18 /**
19 * The field to use as an ID. Values in the column must be unique.
20 * If the header is transformed, it is the value _after_ transformation.
21 * Default is the first column.
22 * */
23 idField?: string;
24 /** Options passed to the CSV parser */
25 parserOptions?: Omit<
26 Papa.ParseConfig,
27 "header" | "dynamicTyping" | "transformHeader" | "step" | "complete"
28 >;
29}
30
31const camelize = (str: string) =>
32 str

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected