As discussed in PR #172, the best approach might be to create a variant of the original function that retains error messages in production. This PR introduces a new version of the function. The original function remains unchanged; a copy was made to include this feature. This approach avoids any breaking changes, requiring only a minor release.
Inspired by the library's author, I named this new variant keep-messages. The final import looks like this:
import invariant from 'tiny-invariant/keep-messages';
invariant(condition, 'This message will be available in production');
Description
As discussed in PR #172, the best approach might be to create a variant of the original function that retains error messages in production. This PR introduces a new version of the function. The original function remains unchanged; a copy was made to include this feature. This approach avoids any breaking changes, requiring only a minor release.
Inspired by the library's author, I named this new variant
keep-messages
. The final import looks like this:Related
172
198
176