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

Commit 45fca5c

Browse files
committed
columns_duplicates_to_array: sample
1 parent a957f1a commit 45fca5c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
const parse = require('..')
3+
const assert = require('assert')
4+
5+
parse(`
6+
friend,username,friend
7+
athos,porthos,aramis
8+
porthos,d_artagnan,athos
9+
`.trim(), {
10+
columns: true,
11+
columns_duplicates_to_array: true
12+
}, function(err, records){
13+
assert.deepEqual(
14+
records, [{
15+
username: 'porthos',
16+
friend: ['athos', 'aramis']
17+
}, {
18+
username: 'd_artagnan',
19+
friend: ['porthos', 'athos']
20+
}]
21+
)
22+
})

0 commit comments

Comments
 (0)