zertosh / invariant

invariant
MIT License
1.22k stars 70 forks source link

Make message optional #19

Closed AlicanC closed 8 years ago

AlicanC commented 8 years ago

We have many cases where specifying a message is redundant. It would be great if the message was optional and defaulted to something simple like "Invariant Violation".

zertosh commented 8 years ago

This lib is supposed to mirror the behavior of the version included in React. If you want an optional message, you can always do const invariant = require('assert');. Node's assert module doesn't require a message.