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

appendBinaryFile() should not accept data which is not binary #113

Open
Sadaf-A opened this issue Jun 9, 2024 · 1 comment
Open

appendBinaryFile() should not accept data which is not binary #113

Sadaf-A opened this issue Jun 9, 2024 · 1 comment

Comments

@Sadaf-A
Copy link
Contributor

Sadaf-A commented Jun 9, 2024

currently appendBinaryFile() accepts data even if it is not binary. It should only accept binary data

@godspeed-03
Copy link

godspeed-03 commented Jun 27, 2024

Since JavaScript (the language TypeScript compiles down to) is dynamically typed, there's no runtime check to ensure the argument matches the specified type.
In this case : appendBinaryFile(path: string, data: ArrayBuffer), here the type of data parameter is ArrayBuffer even if accept data which is not binary perhaps because the code isn't type-checked by TypeScript at runtime.
@Sadaf-A if this if the case then if can be fixed with instace check which will check the type of data at runtime.

Looking forward to dicuss it with you 😄

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

No branches or pull requests

2 participants