You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which would be possible by determining if the options parameter is a string or an object. However that raises the case of what to do when the units passed are wrong? The current behavior is to return null which is unambiguous since if you do bytes('1ky'), the only error possible comes from the unit. But if you do so with bytes('1My', 'ku') or bytes('1mb', 'ku') we do not know from where the error comes from (although easy to guess).
Some possible solutions:
Keep the current behavior which returns null and let the user guess his error
Throw an error to display a more user friendly error, but I don't like the idea to have a try/catch for using this utility
ei, if I want to display disk usage. Used converts to 20 mb, max to 2tb. Be nice to be able to have them same unit.
something like:
The text was updated successfully, but these errors were encountered: