feat!: support for request options - #36
Open
bojan88 wants to merge 9 commits into
Open
Conversation
bojan88
force-pushed
the
req-options-support
branch
7 times, most recently
from
August 12, 2026 16:17
089a47d to
1d3895c
Compare
Signed-off-by: Bojan Đurđević <bojan88@gmail.com> Assisted-by: GitHub Copilot
Signed-off-by: Bojan Đurđević <bojan88@gmail.com> Assisted-by: GitHub Copilot
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
bojan88
force-pushed
the
req-options-support
branch
from
August 12, 2026 16:24
1d3895c to
46fe557
Compare
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
bojan88
force-pushed
the
req-options-support
branch
from
August 14, 2026 13:48
6a08fac to
4cbee7a
Compare
bojan88
commented
Aug 14, 2026
| const { base, axiosInstance, encodeQueryStrings } = config; | ||
| /* c8 ignore next 3 */ | ||
| if (!this.#axiosInstance && typeof fetch !== 'function') { | ||
| if (!axiosInstance && typeof fetch !== 'function') { |
Contributor
Author
There was a problem hiding this comment.
This wasn't part of this feature, but it was incorrect
bojan88
commented
Aug 14, 2026
| } = await this.#axiosInstance[ | ||
| method.toLowerCase() as Lowercase<Method> | ||
| ](url, requestData, { | ||
| ...(reqOptions as AxiosRequestConfig), |
Contributor
Author
There was a problem hiding this comment.
This type here couldn't be narrower based on Client generic, so it's either casting here or having a type guard like isAxiosClient(reqOptions): reqOptions is AxiosRequestConfig | undefined => !!this.#axiosInstance
bojan88
commented
Aug 14, 2026
| } | ||
|
|
||
| const fetchResponse = await fetch(url, { | ||
| ...(reqOptions as RequestInit), |
Contributor
Author
There was a problem hiding this comment.
The same as comment above, and we have more occurrences bellow.
bojan88
commented
Aug 14, 2026
| // @ts-expect-error testing missing name | ||
| .select([ | ||
| pgClient.embeddedQuery('directors', 'one').select('*'), | ||
| // @ts-expect-error testing missing name |
Contributor
Author
There was a problem hiding this comment.
This change came from typescript upgrade.
The reason for the upgrade were incorrectly flagged errors for headers?.entries() bellow - the old version of typescript is not aware of .entries() method on Headers class
Signed-off-by: Bojan Đurđević <bojan88@gmail.com>
bojan88
marked this pull request as ready for review
August 14, 2026 15:23
ferryxo
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE:
headersare moved to 2nd argument in.get,.post, etc. methods.Instead of
.get({ query, headers })we now have.get({ query }, { headers, signal, ... }).Before this change we could only pass headers and other options like abort signal for example were not supported.
One option to test this is to run
npm run packand install the produced package in your local project.