ente/web/packages/base/assert.ts
Manav Rathi 5c7c4ad35a
Fix
2024-08-09 11:41:59 +05:30

12 lines
303 B
TypeScript

import { isDevBuild } from "./env";
import log from "./log";
/**
* If running in a dev build, throw an exception with the given message.
* Otherwise log it as a warning.
*/
export const assertionFailed = (message: string) => {
if (isDevBuild) throw new Error(message);
log.warn(message);
};