prismatic-io / spectral

Prismatic's typescript library for custom components
https://prismatic.io/docs/spectral/custom-component-library
35 stars 2 forks source link

Account for empty strings in toBool() and toInt() #12

Closed taylorreece closed 3 years ago

taylorreece commented 3 years ago

Reasoning: Boolean('') === false, so toBool('') should probably also return false (rather than its current behavior of throwing an error.

For toInt(), I'd expect empty string to behave the same as undefined.