Skip to content
Myr

feat(parseBody): allow passing generics to `parseBody()` (#1289)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* feat(parseBody): allow passing generics to `parseBody()` * denoify

authored by Yusuke Wada · committed by GitHub · parent a7dd281 · Browse files · 4 files+10 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+10 added−6 removed

  • other:+10 added−6 removed

4 files+10 added−6 removed

modified:deno_dist/utils/body.ts+4 added-2 removed
modified:deno_dist/request.ts+1 added-1 removed
110 unmodified lines
111 return obj112 }113 }114115 async parseBody(): Promise<BodyData> {115 async parseBody<T extends BodyData = BodyData>(): Promise<T> {116 return await parseBody(this.raw)117 }118119 // eslint-disable-next-line @typescript-eslint/no-explicit-any
66 unmodified lines
modified:src/utils/body.ts+4 added-2 removed
modified:src/request.ts+1 added-1 removed
110 unmodified lines
111 return obj112 }113 }114115 async parseBody(): Promise<BodyData> {115 async parseBody<T extends BodyData = BodyData>(): Promise<T> {116 return await parseBody(this.raw)117 }118119 // eslint-disable-next-line @typescript-eslint/no-explicit-any
66 unmodified lines