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

Commit 8200a33

Browse files
committed
to_line: simple sample
1 parent 46c958a commit 8200a33

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## Trunk
1414

15+
* to_line: simple sample
1516
* trim: support form feed character
1617
* sync: disregard emitted null records
1718
* comment: simple sample

samples/option.to_line.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const parse = require('../lib/sync')
2+
const assert = require('assert')
3+
4+
const records = parse(`
5+
a,1
6+
b,1
7+
x,x
8+
`.trim(), {
9+
to_line: 2
10+
})
11+
assert.deepEqual(
12+
records, [
13+
[ 'a', '1' ],
14+
[ 'b', '1' ]
15+
]
16+
)

0 commit comments

Comments
 (0)