diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-08-10 13:59:47 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-08-10 13:59:47 +0200 |
| commit | 52b9437f51ab0178c92042a152e784ccdc68aeb0 (patch) | |
| tree | fdeebe152fea08fd720418acac2ed2424496daf4 /src | |
| parent | 79b1e73eca9f54146522340d9094ab818b29f547 (diff) | |
| download | bycs-sol-52b9437f51ab0178c92042a152e784ccdc68aeb0.tar.gz bycs-sol-52b9437f51ab0178c92042a152e784ccdc68aeb0.zip | |
add assert depending on the build mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/assert.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/assert.ts b/src/assert.ts new file mode 100644 index 0000000..5589895 --- /dev/null +++ b/src/assert.ts @@ -0,0 +1,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 }; |
