MCPcopy
hub / github.com/hello-pangea/dnd / invariant

Function invariant

src/invariant.ts:16–32  ·  view source on GitHub ↗
(
  condition: unknown,
  message?: string,
)

Source from the content-addressed store, hash-verified

14// eslint-disable-next-line @typescript-eslint/no-explicit-any
15export function invariant(condition: any, message?: string): asserts condition;
16export function invariant(
17 condition: unknown,
18 message?: string,
19): asserts condition {
20 if (condition) {
21 return;
22 }
23
24 if (isProduction) {
25 // In production we strip the message but still throw
26 throw new RbdInvariant(prefix);
27 } else {
28 // When not in production we allow the message to pass through
29 // *This block will be removed in production builds*
30 throw new RbdInvariant(`${prefix}: ${message || ''}`);
31 }
32}

Calls

no outgoing calls

Tested by 9

wasOnBeforeCaptureCalledFunction · 0.72
wasOnBeforeDragCalledFunction · 0.72
wasDragStartedFunction · 0.72
getPlaceholderFunction · 0.72
executeFunction · 0.72
CanThrowFunction · 0.72
getToDropAnimationFunction · 0.72
setBoundingClientRectFunction · 0.72
resetFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…