`appendBinaryFile()` should not accept data which is not binary
Opened this issue · 1 comments
Sadaf-A commented
currently appendBinaryFile()
accepts data even if it is not binary. It should only accept binary data
godspeed-03 commented
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 😄