Skip to content

Commit

Permalink
chore(deps): update dependency typescript to ~3.2.0 (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and JustinBeckwith committed Nov 30, 2018
1 parent e80f75d commit cbc8fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"proxyquire": "^2.0.1",
"request": "^2.88.0",
"source-map-support": "^0.5.6",
"typescript": "~3.1.0"
"typescript": "~3.2.0"
},
"peerDependencies": {
"bunyan": "*"
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ export class LoggingBunyan extends Writable {
write(...args: any[]): boolean {
let record = args[0];
let encoding: string|null = null;
let callback: Function;
type Callback = (error: Error|null|undefined) => void;
let callback: Callback|string;
if (typeof args[1] === 'string') {
encoding = args[1];
callback = args[2];
Expand All @@ -266,9 +267,9 @@ export class LoggingBunyan extends Writable {
}
}
if (encoding !== null) {
return super.write.call(this, record, encoding, callback);
return super.write.call(this, record, encoding, callback as Callback);
} else {
return super.write.call(this, record, callback);
return super.write.call(this, record, callback as string);
}
}

Expand Down

0 comments on commit cbc8fd3

Please sign in to comment.