web-csv-toolbox - v0.15.0
    Preparing search index...

    Interface StringObjectCSVParser<Header>

    String CSV Parser interface for object output format.

    StringObjectCSVParser parses string CSV data and returns records as objects. Each record is a key-value object where keys are header field names.

    This interface is designed to be easily implemented in Rust/WASM with clear type semantics.

    const parser: StringObjectCSVParser<['name', 'age']> = ...;
    for (const record of parser.parse('Alice,30\nBob,25')) {
    console.log(record); // { name: 'Alice', age: '30' }
    }
    interface StringObjectCSVParser<
        Header extends ReadonlyArray<string> = readonly string[],
    > {
        parse(
            chunk?: string,
            options?: CSVParserParseOptions,
        ): IterableIterator<Record<Header[number], string>>;
    }

    Type Parameters

    • Header extends ReadonlyArray<string> = readonly string[]

      Array of header field names

    Implemented by

    Index

    Methods

    Methods

    • Parse a chunk of CSV string data into object records.

      Parameters

      • Optionalchunk: string

        CSV string chunk to parse (optional for flush)

      • Optionaloptions: CSVParserParseOptions

        Parse options

      Returns IterableIterator<Record<Header[number], string>>

      Iterable iterator of parsed CSV records as objects