Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(csv): more examples for stringify and CsvStringifyStream #5606

Merged
merged 9 commits into from
Aug 2, 2024

Conversation

magurotuna
Copy link
Member

@magurotuna magurotuna commented Aug 1, 2024

No description provided.

@github-actions github-actions bot added the csv label Aug 1, 2024
csv/stringify.ts Outdated
* assertEquals(stringify(data), `Rick,70\r\nMorty,14\r\n`);
* ```
*
* @example an array of objects and specify columns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please tweak the example titles to have the correct casing, like those in #5605?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

Comment on lines +55 to +74
* @example Write TSV to a file
* ```ts
* import { CsvStringifyStream } from "@std/csv/stringify-stream";
* import { assertEquals } from "@std/assert/equals";
*
* async function writeTsvToTempFile(): Promise<string> {
* const path = await Deno.makeTempFile();
* using file = await Deno.open(path, { write: true });
*
* const readable = ReadableStream.from([
* { id: 1, name: "one" },
* { id: 2, name: "two" },
* { id: 3, name: "three" },
* ]);
*
* await readable
* .pipeThrough(
* new CsvStringifyStream({
* columns: ["id", "name"],
* separator: "\t",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add more examples to give as many guides as stringify function, but in order to achieve this we need to address #5219 (comment)

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.37%. Comparing base (b0f2088) to head (197d560).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5606   +/-   ##
=======================================
  Coverage   96.37%   96.37%           
=======================================
  Files         466      466           
  Lines       37587    37587           
  Branches     5542     5542           
=======================================
  Hits        36226    36226           
  Misses       1319     1319           
  Partials       42       42           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@magurotuna magurotuna marked this pull request as ready for review August 2, 2024 04:44
@magurotuna magurotuna requested a review from kt3k as a code owner August 2, 2024 04:44
@magurotuna magurotuna merged commit 2accb2b into denoland:main Aug 2, 2024
15 checks passed
@magurotuna magurotuna deleted the magurotuna/csv-stringify branch August 2, 2024 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants