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

Commit

Permalink
ts: enable strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Nov 16, 2020
1 parent 987e978 commit 71faf94
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Please join and contribute:

## Trunk

* ts: enable strict mode
* package: mocha inside package declaration

## Version 4.14.0
Expand Down
6 changes: 3 additions & 3 deletions test/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ describe('API Types', () => {
})

it('Receive Callback', (next) => {
parse('a\nb', function(err: Error, data: object, info: Info){
parse('a\nb', function(err: Error|undefined, records: object, info: Info){
if(err !== undefined){
data.should.eql([['a'], ['b']])
records.should.eql([['a'], ['b']])
info.records.should.eql(2)
}
next(err)
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('API Types', () => {
})

it('Proper type is thrown when an error is encountered', () => {
parse(`a,b\nc`, function (e: Error) {
parse(`a,b\nc`, function (e: Error|undefined) {
const isCsvError = e instanceof CsvError;
isCsvError.should.be.true();
(e as CsvError).code.should.eql('CSV_INCONSISTENT_RECORD_LENGTH');
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compileOnSave": false,
"compilerOptions": {
"target": "es6",
"moduleResolution": "node",
"strict": true,
}
}

0 comments on commit 71faf94

Please sign in to comment.