MCPcopy
hub / github.com/signalapp/Signal-Desktop / assertDev

Function assertDev

ts/util/assert.std.ts:34–46  ·  view source on GitHub ↗
(
  condition: unknown,
  message: string
)

Source from the content-addressed store, hash-verified

32 * In production, logs an error and continues. In all other environments, throws an error.
33 */
34export function assertDev(
35 condition: unknown,
36 message: string
37): asserts condition {
38 if (!condition) {
39 const err = new Error(message);
40 if (getEnvironment() !== Environment.PackagedApp) {
41 devDebugger();
42 throw err;
43 }
44 log.error('failure:', Errors.toLogFormat(err));
45 }
46}
47
48/**
49 * Throws an error if the condition is falsy, regardless of environment.

Callers 15

#commitZoneChangesMethod · 0.90
#enterZoneMethod · 0.90
#leaveZoneMethod · 0.90
storeSessionMethod · 0.90
lightSessionResetMethod · 0.90
isEnabledFunction · 0.90
getValueFunction · 0.90
#persistMethod · 0.90
timeUntilNextRefreshFunction · 0.90
buildAddMembersChangeFunction · 0.90
createGroupV2Function · 0.90

Calls 3

getEnvironmentFunction · 0.90
devDebuggerFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected