Skip to content
Permalink
Browse files

skip_lines_with_error: new sample

  • Loading branch information...
wdavidw committed Feb 14, 2019
1 parent bbb3045 commit c1303412ed607eba514bb9403086161c6060919a
Showing with 29 additions and 0 deletions.
  1. +5 −0 CHANGELOG.md
  2. +24 −0 samples/option.skip_lines_with_error.js
@@ -3,9 +3,14 @@

## Todo

* skip_lines_with_error: rename to skip_records_with_error
* max_comment_size: new option
* promise: new API module

## Trunk

* skip_lines_with_error: new sample

## Version 4.3.3

Fix:
@@ -0,0 +1,24 @@
const parse = require('..')
const assert = require('assert')

parser = parse({
skip_lines_with_error: true
}, function(err, records){
assert.deepEqual(
records, [
['a', 'b', 'c'],
['d', 'e', 'f'],
['h', 'i', 'j']
]
)
})
parser.on( 'skip', function(err){
assert(/^Invalid Closing Quote/.test(err.message))
})
parser.write(`
"a","b","c"
"d","e","f"
"invalid"," " ","record"
"h","i","j"
`.trim())
parser.end()

0 comments on commit c130341

Please sign in to comment.
You can’t perform that action at this time.