lodash-invariants
Invariants for lodash.is* methods
Made with ❤ at @outlandish
Install
import invariants from 'lodash-invariants'
Import
// ES2015 // CommonJSvar invariants =
API
invariants.is*(name, ...args)
- name {String} Name of what is being inspected
- ...args {*} Arguments to pass to the
lodash.is*
method
Throws an Invariant Exception if the lodash.is*
method returns false.
Example
{ invariants} //=> Invariant Exception: Expecting options.url to be string, got number.
If you have your own invariants, merge lodash-invariants
into them:
// ./invariants.js
Contributing
All pull requests and issues welcome!
If you're not sure how, check out Kent C. Dodds' great video tutorials on egghead.io!
Author & License
lodash-invariants
was created by Sam Gluck and is released under the MIT license.