Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(types): Mark FileWriter.write to support ArrayBuffer data #547

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

peitschie
Copy link
Contributor

FileWriter.js clearly supports this type, and it allows memory conscious users to avoid unnecessary duplication of the memory as occurs when using a Blob.

Platforms affected

Type-only change

Motivation and Context

Avoid forcing unnecessary duplication of memory when attempting to write files

Description

Clarifies FileWriter.write type definition to properly reflect the method's support for an ArrayBuffer type directly:

isBinary = supportsBinary && (data instanceof ArrayBuffer);

Testing

Type-only change. Have confirmed new type behaves correctly with code passing in an ArrayBuffer.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

FileWriter.js clearly supports this type, and it allows memory conscious users to
avoid unnecessary duplication of the memory as occurs when using a Blob.
@breautek breautek added this to the 7.0.1 Patch milestone Dec 6, 2022
Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

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

The unit tests have been broken so I think they can be ignored for this PR, and this change wouldn't cause breakage either.

@breautek breautek merged commit 1601b60 into apache:master Dec 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants