We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b96f459 commit 965e790Copy full SHA for 965e790
src/utils/invariant.ts
@@ -1,13 +1,8 @@
1
-const isProduction: boolean = process.env.NODE_ENV === 'production';
2
-const prefix = 'Invariant failed';
3
-
4
export function invariant(
5
condition: boolean,
6
message: string,
7
): asserts condition {
8
if (condition) return;
9
10
- if (isProduction) throw new Error(prefix);
11
12
- throw new Error(message ? `${prefix}: ${message}` : prefix);
+ throw new Error(message);
13
}
0 commit comments