bitpay/bitcore — pull request #695 by eordano (2014-12-10 14:50:15+00:00)
Title: Add a preconditions module, and refactor errors

100% code coverage for the preconditions module.

Usage:
```
$.checkState(something === anotherthing, 'Expected something to be anotherthing');
$.checkArgument(something < 100, 'something', 'must be less than 100');
$.checkArgumentType(something, PrivateKey, 'something'); // The third argument is a helper to mention the name of the argument
$.checkArgumentType(something, PrivateKey); // but it's optional (will show up as "(unknown argument)")
```