Skip to content

Commit 2ec1cd7

Browse files
committed
Chore: Remove some uesless types
1 parent 263d122 commit 2ec1cd7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/lib/CoaRequestBody.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { IncomingMessage } from 'http'
44

55
const DefaultMaxBodySize = 10 * 1024 * 1024
66

7-
interface RequestBodyParams{
7+
interface RequestBodyParams {
88
rawBody: string
99
body: { [key: string]: any}
1010
}
@@ -55,7 +55,9 @@ export class CoaRequestBody {
5555

5656
protected async getRawBody (contentLength: number) {
5757
return await new Promise<string>((resolve, reject) => {
58-
let raw = [] as Buffer[]; let received = 0; let destroy = false
58+
let raw = [] as Buffer[]
59+
let received = 0
60+
let destroy = false
5961

6062
const onAborted = () => {
6163
// console.log('onAborted')

src/service/CoaApplication.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class CoaApplication<T extends CoaContext> {
1616
echo.info('[server] Booting...')
1717
}
1818

19-
async start (entry: string = ''): Promise<void> {
19+
async start (entry: string = '') {
2020
// 设置端口
2121
const port = parseInt(process.env.HOST || '') || 8000
2222

@@ -29,7 +29,7 @@ export class CoaApplication<T extends CoaContext> {
2929
}
3030

3131
// 监听请求
32-
private async requestListener (req: IncomingMessage, res: ServerResponse): Promise<void> {
32+
private async requestListener (req: IncomingMessage, res: ServerResponse) {
3333
const ctx = new this.Context(req, res)
3434

3535
try {

src/service/CoaHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { CoaApplication } from './CoaApplication'
55
import { CoaContext, CoaContextConstructor } from './CoaContext'
66
import { CoaRouter, CoaRouterConfig, CoaRouterRoutes } from './CoaRouter'
77

8-
interface CoaHttpConfig extends CoaRouterConfig, CoaSwaggerConfig{
8+
interface CoaHttpConfig extends CoaRouterConfig, CoaSwaggerConfig {
99
routeDir: string
1010
}
1111

0 commit comments

Comments
 (0)