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

Commit

Permalink
ts: add buffer as allowed type for input, fix #248
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Aug 9, 2019
1 parent 9c53199 commit fecf171
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
* max_comment_size: new option
* promise: new API module

## Trunk

* ts: add buffer as allowed type for input, fix #248

## Version 4.4.4

* package: latest dependencies
Expand Down
17 changes: 17 additions & 0 deletions test/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ describe('API Types', () => {

describe('Parser', () => {

it('Respect parse signature', () =>{
// No argument
parse()
parse("")
parse("", () => {})
parse("", {})
parse("", {}, () => {})
parse(Buffer.from(""))
parse(Buffer.from(""), () => {})
parse(Buffer.from(""), {})
parse(Buffer.from(""), {}, () => {})
parse(() => {})
parse({})
parse({}, () => {})
})

it('Expose options', () => {
const parser: Parser = parse()
const options: Options = parser.options
Expand Down Expand Up @@ -107,6 +123,7 @@ describe('API Types', () => {
return fields
}
options.columns = (record: string[]) => {
record
return ['string', undefined, null, false, {name: 'column-name'}]
}
})
Expand Down

0 comments on commit fecf171

Please sign in to comment.