-
Notifications
You must be signed in to change notification settings - Fork 629
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
Conversation
csv/stringify.ts
Outdated
* assertEquals(stringify(data), `Rick,70\r\nMorty,14\r\n`); | ||
* ``` | ||
* | ||
* @example an array of objects and specify columns |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
* @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", |
There was a problem hiding this comment.
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)
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
No description provided.