Skip to content

feat: avoid modifying the response object when calling response.text() - #854

Merged
kanadgupta merged 3 commits into
readmeio:mainfrom
franciscopantojag:feat/avoid-modifying-res-object-when-text-method-is-called
Feb 12, 2024
Merged

feat: avoid modifying the response object when calling response.text()#854
kanadgupta merged 3 commits into
readmeio:mainfrom
franciscopantojag:feat/avoid-modifying-res-object-when-text-method-is-called

Conversation

@franciscopantojag

Copy link
Copy Markdown
Contributor
馃殽 Resolves ISSUE_ID

馃О Changes

  • Avoid mutating the response object when calling response.text(). This can be helpful if we want to consume the response in a different way, like response.arrayBuffer() when working with files

馃К QA & Testing

  • With this change, the original response object is returned.

@erunion erunion added the enhancement New feature or request label Feb 8, 2024
@erunion
erunion requested review from erunion and kanadgupta February 8, 2024 17:21

@kanadgupta kanadgupta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi there! thanks for this change, it looks great. could you add a test? this is the file you'll want to add your test(s) to: https://github.com/readmeio/api/blob/main/packages/core/test/lib/parseResponse.test.ts

let us know if you need a hand, thanks!

@franciscopantojag

Copy link
Copy Markdown
Contributor Author

Hello @kanadgupta , test added!
Thanks for the suggestion 馃槉

@kanadgupta kanadgupta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks so much again @franciscopantojag!

@kanadgupta
kanadgupta merged commit f95874b into readmeio:main Feb 12, 2024
@kanadgupta kanadgupta added the area:core Issues related to `core`, which is the package that powers the SDKs at runtime label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Issues related to `core`, which is the package that powers the SDKs at runtime enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants