Skip to content

Commit

Permalink
fix: method is not required for request api (#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
snyamathi authored Feb 3, 2022
1 parent eff93fb commit 1204ed1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/types/api.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Dispatcher, request, stream, pipeline, connect, upgrade } from '../..'

// request
expectAssignable<Promise<Dispatcher.ResponseData>>(request(''))
expectAssignable<Promise<Dispatcher.ResponseData>>(request('', { }))
expectAssignable<Promise<Dispatcher.ResponseData>>(request('', { method: 'GET' }))

// stream
Expand Down
2 changes: 1 addition & 1 deletion types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export {
/** Performs an HTTP request. */
declare function request(
url: string | URL | UrlObject,
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path'>,
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
): Promise<Dispatcher.ResponseData>;

/** A faster version of `request`. */
Expand Down

0 comments on commit 1204ed1

Please # to comment.