philbooth/check-types.js — pull request #14 by ricardmo (2013-10-26 19:22:21+00:00)
Title: Treat 'verify' as a wrapper.

In the current state of the library, there are two *families* of functions: `isWhatever` that returns a boolean and `verifyWhatever` that calls `isWhatever` and throws and error if the answer is false.

The way I see things, `verify` is only a helper around the core functionality of the predicate and should be treated in that way.

e.g.: `check.verifyObject({})` becomes `check.verify.isObject({})`.

I think that by going in that direction:

* We reduce the cognitive load of using the library (one only needs to remember `is*` function names)
* It is clearer what the function actually does
* The code base will be easier to maintain (much smaller and we only need to bother about the predicates implementations)
* New functionalities will be easier to add.
* New modifiers/wrappers will be easy to add.

Keep in mind that this pull request does not break the actual syntax of the library, it only adds `check.verify.*` verifiers.

I am aware that this is quite an opinionated change but it corresponds to the way I want to use the library.