Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
relax_column_count: example with columns
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 21, 2018
1 parent 8d76818 commit 31d2793
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions samples/option.relax_column_count.columns.js
@@ -0,0 +1,21 @@

const parse = require('../lib')
const assert = require('assert')

parse(`
lastname,firstname,fullname
Ritchie
Lovelace,Ada,"Augusta Ada King, Countess of Lovelace"
`.trim(), {
relax_column_count: true,
columns: true
}, function(err, records){
assert.deepEqual(
records, [
{ lastname: 'Ritchie' },
{ lastname: 'Lovelace',
firstname: 'Ada',
fullname: 'Augusta Ada King, Countess of Lovelace' }
]
)
})
2 changes: 1 addition & 1 deletion test/options.coffee
Expand Up @@ -14,7 +14,7 @@ describe 'Options', ->
(options.quote is false).should.be.true()
next()

it 'camelize options', ->
it 'underscore options', ->
parser = parse recordDelimiter: ':'
parser.options.record_delimiter.toString().should.eql ':'
(parser.options.recordDelimiter is undefined).should.be.true()

0 comments on commit 31d2793

Please sign in to comment.