Closed blasdfaa closed 11 months ago
I am not so sure about it. I think the usage is a bit unclear and you don't always want to convert false
to false. Without that conversion, I think a Boolean(value)
would already do the thing.
I am not so sure about it. I think the usage is a bit unclear and you don't always want to convert
false
to false. Without that conversion, I think aBoolean(value)
would already do the thing.
Such a function could be useful when converting boolean strings. For example, query parameters (foo=true&bar=false
)
Yes, I knew. And also for env value parsing, I suppose. My point is that they are specific use cases. In general, most of the time, you don't want this convention. Even if you two, it's just a few line in the code base to create a local util. I think I am not confident to have it in this project. Thanks for bringing this up.
Description
Converts any value to a boolean value.
Linked Issues
N/A
Additional context
N/A