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

    Interface BinaryObjectCSVParser<Header>

    Binary CSV Parser interface for object output format.

    BinaryObjectCSVParser parses binary 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: BinaryObjectCSVParser<['name', 'age']> = ...;
    const data = new TextEncoder().encode('Alice,30\nBob,25');
    for (const record of parser.parse(data)) {
    console.log(record); // { name: 'Alice', age: '30' }
    }
    interface BinaryObjectCSVParser<
        Header extends ReadonlyArray<string> = readonly string[],
    > {
        parse(
            chunk?: BufferSource,
            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 binary data into object records.

      Parameters

      • Optionalchunk: BufferSource

        CSV binary chunk (BufferSource: Uint8Array, ArrayBuffer, or other TypedArray) to parse (optional for flush)

      • Optionaloptions: CSVParserParseOptions

        Parse options

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

      Iterable iterator of parsed CSV records as objects