Repository navigation
feat(csv-parse): add an async iterator API - #534
Open
Aurantium-47 wants to merge 1 commit into
Open
Aurantium-47 wants to merge 1 commit into
Aurantium-47 wants to merge 1 commit into
Conversation
Parse asynchronous chunk iterables with the existing CSV core, including EOF, early termination, types, packaged distributions, tests and documentation. Refs: adaltas#447 Assisted-by: OpenAI GPT-6 <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the async-generator interface requested in #447 as
csv-parse/iterator, with a browser ESM entry and the existing CJS/IIFE/UMD distributions. It reuses the parsing core, yields every record before requesting another input chunk, flushes the final record, and closes the input on consumer cancellation or parser limits. Includes non-stream option types, documentation and an executable sample.Validation: 21 focused tests; 641 package tests passed with 3 existing pending tests; build, types and focused lint passed. Packed ESM/CJS consumers and NodeNext declarations passed. Real file roundtrips use one-byte chunks, and Edge runs the packed ESM/IIFE/UMD entries with native fetch, Unicode/BOM splits, cancellation and error checks. The Windows package-suite run uses a temporary path adapter for four existing test/sample fixtures; the new focused and packed/browser checks run without it.
One existing assertion changes only
an booleantoa boolean, matching the production message already accepted in #525. The full error-code/message assertion remains intact; production normalization is unchanged.Implemented and tested with AI assistance (Codex). No performance improvement is claimed.