Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support SharedArrayBuffer in HttpResponse.arrayBuffer #2389

Merged
merged 3 commits into from
Dec 15, 2024

Conversation

danilofuchs
Copy link
Contributor

@danilofuchs danilofuchs commented Dec 11, 2024

Fixes #2388

I've added support for using SharedArrayBuffer as an argument to HttpResponse.arrayBuffer()

This is necessary as in Typescript 5.7 with lib ES2024, Buffer is no longer assignable to simply ArrayBuffer

When testing this, the default content type was being text/plain;charset=utf-8

I'm not sure if I did the right thing by setting the default to application/octet-stream (this is the only method without a default)

@kettanaito kettanaito changed the title fix: allow HttpResponse.arrayBuffer to receive a SharedArrayBuffer fix: support SharedArrayBuffer in HttpResponse.arrayBuffer Dec 14, 2024
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

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

This looks great! Thank you so much for fixing this, @danilofuchs 👏

@kettanaito
Copy link
Member

The Node.js tests are failing to unrelated reasons (see #2386). I'd love to fix that one first before merging this one so we get clean test runs.

@kettanaito
Copy link
Member

Thanks once again for shipping this, @danilofuchs. Welcome to contributors! 🎉

@kettanaito kettanaito merged commit 41f00e1 into mswjs:main Dec 15, 2024
17 checks passed
@kettanaito
Copy link
Member

Released: v2.6.9 🎉

This has been released in v2.6.9!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@danilofuchs
Copy link
Contributor Author

Happy to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Typescript lib es2024 and arrayBuffer, types are hard to use
2 participants