Skip to content

Commit

Permalink
fix(query): fixed some typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eddienubes committed Feb 14, 2024
1 parent 26e07d5 commit 4754663
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Sage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export class Sage {

/**
* Sets query parameters for the request.
* @param query
* @param query Supposed to be just a record of strings and numbers.
* Other values/types will be ignored.
*/
query(query: Record<string | number, string | number>): this {
query(query: object): this {
this.request.query = query;
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SageHttpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IncomingHttpHeaders } from 'undici/types/header.js';
export interface SageHttpRequest {
method?: HttpMethod;
path?: string;
query?: Record<string | number, string | number>;
query?: object;

// Should always be a string since Undici doesn't support other types
body?: string;
Expand Down

0 comments on commit 4754663

Please sign in to comment.