@rip-lang/csv 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/csv.rip +10 -7
  2. package/package.json +1 -1
package/csv.rip CHANGED
@@ -369,13 +369,16 @@ class Writer
369
369
 
370
370
  formatted = switch @mode
371
371
  when 'compact'
372
- for cell in cells
373
- if @excel and @leadZero.test(cell)
374
- "=#{q}#{cell}#{q}"
375
- else if @needsQuote(cell)
376
- "#{q}#{cell.replaceAll(q, esc)}#{q}"
377
- else
378
- cell
372
+ if not @excel and not @needsQuote(cells.join(''))
373
+ cells
374
+ else
375
+ for cell in cells
376
+ if @excel and @leadZero.test(cell)
377
+ "=#{q}#{cell}#{q}"
378
+ else if @needsQuote(cell)
379
+ "#{q}#{cell.replaceAll(q, esc)}#{q}"
380
+ else
381
+ cell
379
382
  when 'full'
380
383
  for cell in cells
381
384
  if @excel and @leadZero.test(cell)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/csv",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Fast, flexible CSV parser and writer for Rip — indexOf ratchet engine, auto-detection, zero dependencies",
5
5
  "type": "module",
6
6
  "main": "csv.rip",