tsc:allowUnreachableCode, eslint:no-unreachable, assert->assertDev
This commit is contained in:
parent
f627a05cf8
commit
eb10aafd7c
57 changed files with 213 additions and 176 deletions
|
@ -22,7 +22,10 @@ export function softAssert(condition: unknown, message: string): void {
|
|||
/**
|
||||
* In production, logs an error and continues. In all other environments, throws an error.
|
||||
*/
|
||||
export function assert(condition: unknown, message: string): asserts condition {
|
||||
export function assertDev(
|
||||
condition: unknown,
|
||||
message: string
|
||||
): asserts condition {
|
||||
if (!condition) {
|
||||
const err = new Error(message);
|
||||
if (getEnvironment() !== Environment.Production) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue