Skip to content

Commit

Permalink
fix: make the Request constructor options typesafe (#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan authored Aug 18, 2023
1 parent b50ef1a commit 75e7d65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class Request<UserData extends Dictionary = Dictionary> {
/**
* `Request` parameters including the URL, HTTP method and headers, and others.
*/
constructor(options: RequestOptions) {
constructor(options: RequestOptions<UserData>) {
ow(options, 'RequestOptions', ow.object);
ow(options.url, 'RequestOptions.url', ow.string);
// 'ow' validation is slow, because it checks all predicates
Expand Down
2 changes: 1 addition & 1 deletion test/core/storages/request_queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ describe('RequestQueue remote', () => {
const r2 = new Request({
url,
method,
userData: {},
userData: {} as any,
});
const r3 = new Request({
url,
Expand Down

0 comments on commit 75e7d65

Please sign in to comment.