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

Commit fecf171

Browse files
committed
ts: add buffer as allowed type for input, fix #248
1 parent 9c53199 commit fecf171

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* max_comment_size: new option
88
* promise: new API module
99

10+
## Trunk
11+
12+
* ts: add buffer as allowed type for input, fix #248
13+
1014
## Version 4.4.4
1115

1216
* package: latest dependencies

test/api.types.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ describe('API Types', () => {
77

88
describe('Parser', () => {
99

10+
it('Respect parse signature', () =>{
11+
// No argument
12+
parse()
13+
parse("")
14+
parse("", () => {})
15+
parse("", {})
16+
parse("", {}, () => {})
17+
parse(Buffer.from(""))
18+
parse(Buffer.from(""), () => {})
19+
parse(Buffer.from(""), {})
20+
parse(Buffer.from(""), {}, () => {})
21+
parse(() => {})
22+
parse({})
23+
parse({}, () => {})
24+
})
25+
1026
it('Expose options', () => {
1127
const parser: Parser = parse()
1228
const options: Options = parser.options
@@ -107,6 +123,7 @@ describe('API Types', () => {
107123
return fields
108124
}
109125
options.columns = (record: string[]) => {
126+
record
110127
return ['string', undefined, null, false, {name: 'column-name'}]
111128
}
112129
})

0 commit comments

Comments
 (0)