mde / true

A JavaScript port of the Unix utility 'true'. Returns the Boolean value `true`
101 stars 26 forks source link

Use package boolean to ensure proper type is returned. #16

Closed apexskier closed 6 years ago

apexskier commented 8 years ago

There's a great npm package boolean, that ensures type safety. You should consider using it.

mde commented 7 years ago

While the issue of type safety is obviously critical, we do have tests that ensure the "true" module does indeed return the Boolean value true. It does seem to be a gap in our testing that we only test the output value, and but not its type. What do you think about adding a test that explicitly checks to see if the returned true value is actually a Boolean? This might be preferable to adding yet another dependency.

Also might be worth noting that whatever changes we make here should probably be made here as well: https://github.com/mde/false

andykog commented 7 years ago

It does seem to be a gap in our testing that we only test the output value, and but not its type. What do you think about adding a test that explicitly checks to see if the returned true value is actually a Boolean

@mde, I was thinking of trying to hack into the true's codebase. You suppose this proposition is suitable for a beginner? BTW, would be nice to have a good-first-contribution label in issues, so beginners could feel more confident about making their first PR)

mde commented 6 years ago

@andykog Yes, this is absolutely the type of issue that could be attacked by a beginner -- someone who cares deeply about the integrity of such an important part of the Internet's infrastructure. It's also important to remember that everything needs to be composable, and that keeping things small is the only important concern when we're developing software.