Skip to content
Myr

refactor(hono-base): remove async/await from `app.request` (#1275)

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

* refactor(hono-base): remove async/await from `app.request` * denoify

authored by Yusuke Wada · committed by GitHub · parent 42294d9 · Browse files · 2 files+6 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

2 files+6 added−6 removed

  • other:+6 added−6 removed

2 files+6 added−6 removed

modified:deno_dist/hono-base.ts+3 added-3 removed
356 unmodified lines
357 fetch = (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => {358 return this.dispatch(request, executionCtx, Env, request.method)359 }360361 request = async (input: Request | string | URL, requestInit?: RequestInit) => {361 request = (input: Request | string | URL, requestInit?: RequestInit) => {362 if (input instanceof Request) {363 if (requestInit !== undefined) {364 input = new Request(input, requestInit)365 }366 return await this.fetch(input)366 return this.fetch(input)367 }368 input = input.toString()369 const path = /^https?:\/\//.test(input) ? input : `http://localhost${mergePath('/', input)}`370 const req = new Request(path, requestInit)371 return await this.fetch(req)371 return this.fetch(req)372 }373374 fire = () => {375 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8 unmodified lines
modified:src/hono-base.ts+3 added-3 removed
356 unmodified lines
357 fetch = (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => {358 return this.dispatch(request, executionCtx, Env, request.method)359 }360361 request = async (input: Request | string | URL, requestInit?: RequestInit) => {361 request = (input: Request | string | URL, requestInit?: RequestInit) => {362 if (input instanceof Request) {363 if (requestInit !== undefined) {364 input = new Request(input, requestInit)365 }366 return await this.fetch(input)366 return this.fetch(input)367 }368 input = input.toString()369 const path = /^https?:\/\//.test(input) ? input : `http://localhost${mergePath('/', input)}`370 const req = new Request(path, requestInit)371 return await this.fetch(req)371 return this.fetch(req)372 }373374 fire = () => {375 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8 unmodified lines