Skip to content

Commit 7de0cc5

Browse files
committed
Add formatter.
1 parent 2f76013 commit 7de0cc5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spec/helper.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,21 @@ export function runHandler(
7373

7474
public send(sendBody: any) {
7575
if (this.writeCalled) {
76-
throw Error("Cannot set headers after they are sent to the client")
76+
throw Error("Cannot set headers after they are sent to the client");
7777
}
7878

7979
const toSend = typeof sendBody === "object" ? JSON.stringify(sendBody) : sendBody;
80-
const body = typeof this.sentBody === 'undefined' ? toSend : this.sentBody + ((toSend as string) || "");
80+
const body =
81+
typeof this.sentBody === "undefined"
82+
? toSend
83+
: this.sentBody + ((toSend as string) || "");
8184
this.end(body);
8285
}
8386

8487
public write(writeBody: any, cb?: () => void) {
8588
this.writeCalled = true;
8689

87-
if (typeof this.sentBody === 'undefined') {
90+
if (typeof this.sentBody === "undefined") {
8891
this.sentBody = writeBody;
8992
} else {
9093
this.sentBody += typeof writeBody === "object" ? JSON.stringify(writeBody) : writeBody;

0 commit comments

Comments
 (0)