Skip to content

Commit 8428c6f

Browse files
renovate[bot]JustinBeckwith
authored andcommitted
chore(deps): update dependency typescript to ~3.2.0 (#209)
1 parent df8ff7f commit 8428c6f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

handwritten/nodejs-logging-bunyan/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"proxyquire": "^2.0.1",
8787
"request": "^2.88.0",
8888
"source-map-support": "^0.5.6",
89-
"typescript": "~3.1.0"
89+
"typescript": "~3.2.0"
9090
},
9191
"peerDependencies": {
9292
"bunyan": "*"

handwritten/nodejs-logging-bunyan/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export class LoggingBunyan extends Writable {
251251
write(...args: any[]): boolean {
252252
let record = args[0];
253253
let encoding: string|null = null;
254-
let callback: Function;
254+
type Callback = (error: Error|null|undefined) => void;
255+
let callback: Callback|string;
255256
if (typeof args[1] === 'string') {
256257
encoding = args[1];
257258
callback = args[2];
@@ -266,9 +267,9 @@ export class LoggingBunyan extends Writable {
266267
}
267268
}
268269
if (encoding !== null) {
269-
return super.write.call(this, record, encoding, callback);
270+
return super.write.call(this, record, encoding, callback as Callback);
270271
} else {
271-
return super.write.call(this, record, callback);
272+
return super.write.call(this, record, callback as string);
272273
}
273274
}
274275

0 commit comments

Comments
 (0)