| 7 | import { AstroError } from "astro/errors"; |
| 8 | |
| 9 | export 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 | |
| 31 | const camelize = (str: string) => |
| 32 | str |
nothing calls this directly
no outgoing calls
no test coverage detected