mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
11 lines
250 B
TypeScript
11 lines
250 B
TypeScript
export function invariant(condition: boolean, message: string) {
|
|
if (process.env.NODE_ENV !== "development") {
|
|
return;
|
|
}
|
|
if (!condition) {
|
|
const error = new Error(message);
|
|
error.name = "Invariant Violation";
|
|
throw error;
|
|
}
|
|
}
|