-
-
Notifications
You must be signed in to change notification settings - Fork 19
Do not throw error for TypedArrays #5
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
Conversation
|
What's the use-case of having |
|
One use case is colormap module. So the same data can be stored as a nested array, plain array or typed array. And it would be really handy to call Of course it can be done manually each time before calling flatten. But considering branching and multiple entries where passed data should be flattened, that just leads to duplicated and too verbose code. |
|
Though ok, the package is prefixed |
|
@dfcreative If you want to flatten anything into an array, just call |
|
Ok, thanks. To my misfortune I did not read readme after main use-case. |
|
No performance difference. It's there for developer UX. In case someone tries to use it with something unexpected (but works) like a string. |
|
But the same may happen with |
|
If you looked at the README, it's one method validated and one method not. I can't quite understand the rest of what you said, sorry. |
Hi @blakeembrey!
This tiny enhancement recognizes typed arrays instead of throwing error.