aboutsummaryrefslogtreecommitdiff
path: root/src/assert.ts
blob: 558989510dd9505f223fef27cd00ac149444cc32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const isProduction = process.env.NODE_ENV === "production";

let assert: (cond: boolean, msg: string) => void;

if (isProduction) {
	assert = function (cond: boolean, msg: string) {
		console.assert(cond, msg);
	};
} else {
	assert = function (_cond: boolean, _msg: string) {};
}

export { assert };