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

Commit

Permalink
columns_duplicates_to_array: sample
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed May 21, 2020
1 parent a957f1a commit 45fca5c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions samples/option.columns_duplicates_to_array.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

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

parse(`
friend,username,friend
athos,porthos,aramis
porthos,d_artagnan,athos
`.trim(), {
columns: true,
columns_duplicates_to_array: true
}, function(err, records){
assert.deepEqual(
records, [{
username: 'porthos',
friend: ['athos', 'aramis']
}, {
username: 'd_artagnan',
friend: ['porthos', 'athos']
}]
)
})

0 comments on commit 45fca5c

Please # to comment.