digidem / comapeo-schema

Data schemas for mapeo data types
MIT License
2 stars 0 forks source link

fix: `validate` shouldn't throw #244

Closed EvanHahn closed 2 months ago

EvanHahn commented 2 months ago

validate's interface was inconsistent. Sometimes, it would throw an error; sometimes, it would return false. This makes it consistent: always return a boolean.

I discovered this when I noticed that a test wasn't passing the right arguments to validate. When I fixed it, I got test failures.

(You could argue that this should work the other way: it should throw instead of returning a boolean. But that's a bigger breaking change.)

EvanHahn commented 2 months ago

Closing in favor of #249.