zertosh / invariant

invariant
MIT License
1.22k stars 70 forks source link

The original intention of developing this library #44

Open ghost opened 3 years ago

ghost commented 3 years ago

Hello, I would like to ask how you came up with the idea of developing this library in the first place, and why the name is called invariant

newbanker-damon commented 2 years ago

I have the same question

c0m1t commented 2 years ago

This might explain it a little more.

This explains how the message could be stripped in production mode.

And they probably named it invariant because the provided condition should not change and always be true. If the value is falsy, it throws an error.

invariant adjective never changing.

noun a function, quantity, or property that remains unchanged when a specified transformation is applied.