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

refactor: prefer Uint8Array & early filename validation #17

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Jan 26, 2024

The PR introduces two changes:

  • Replace Buffer.from with Uint8Array
    • Uint8Array is JavaScript built-in and should be preferred. Buffer is just a subclass of Uint8Array with extra methods we don't need
  • Fail early if the finalFilename is invalid, before fetch even begins.

@outloudvi outloudvi self-assigned this Jan 27, 2024
@outloudvi outloudvi added the enhancement New feature or request label Jan 27, 2024
@outloudvi outloudvi merged commit ee1562d into suisei-cn:master Jan 27, 2024
@outloudvi
Copy link
Contributor

Thanks for the change, Sukka!
As there are behavioral changes for invalid filenames, I guess I shall at least bump a minor version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants