diff --git a/packages/csv/samples/pipe.js b/packages/csv/samples/pipe.js index 4797361a..ad41fc41 100644 --- a/packages/csv/samples/pipe.js +++ b/packages/csv/samples/pipe.js @@ -23,5 +23,5 @@ csv .pipe(csv.stringify({ quoted: true })) -// Print the CSV stream to stdout + // Print the CSV stream to stdout .pipe(process.stdout); diff --git a/packages/csv/samples/sync.js b/packages/csv/samples/sync.js index f9d3b60c..5d55b817 100644 --- a/packages/csv/samples/sync.js +++ b/packages/csv/samples/sync.js @@ -1,19 +1,12 @@ - -import assert from 'node:assert'; -import {generate, parse, transform, stringify} from 'csv/sync'; +import assert from "node:assert"; +import { generate, parse, transform, stringify } from "csv/sync"; // Run the pipeline -const input = generate({seed: 1, columns: 2, length: 5}); +const input = generate({ seed: 1, columns: 2, length: 2 }); const rawRecords = parse(input); -const refinedRecords = transform(rawRecords, function(data){ - return data.map(function(value){return value.toUpperCase();}); -}); +const refinedRecords = transform(rawRecords, (data) => + data.map((value) => value.toUpperCase()) +); const output = stringify(refinedRecords); // Print the final result -assert.equal(output, - `OMH,ONKCHHJMJADOA -D,GEACHIN -NNMIN,CGFDKB -NIL,JNNMJADNMINL -KB,DMIM -`); +assert.equal(output, `OMH,ONKCHHJMJADOA\nD,GEACHIN\n`);