MCPcopy Create free account
hub / github.com/brillout/react-streaming / assertUsage

Function assertUsage

src/utils/assert.ts:56–66  ·  view source on GitHub ↗
(condition: unknown, errorMessage: string)

Source from the content-addressed store, hash-verified

54}
55
56function assertUsage(condition: unknown, errorMessage: string): asserts condition {
57 if (condition) {
58 return
59 }
60 const whiteSpace = errorMessage.startsWith('[') ? '' : ' '
61 const usageError = createErrorWithCleanStackTrace(
62 `${usageErrorPrefix}${whiteSpace}${errorMessage}`,
63 numberOfStackTraceLinesToRemove,
64 )
65 throw usageError
66}
67
68function getProjectError(errorMessage: string) {
69 const pluginError = createErrorWithCleanStackTrace(`${errorPrefix} ${errorMessage}`, numberOfStackTraceLinesToRemove)

Callers 12

render.tsxFile · 0.90
assertVersionFunction · 0.85
assertKeyFunction · 0.85
renderToStreamFunction · 0.85
doNotCloseFunction · 0.85
assertReactFunction · 0.85
index.tsFile · 0.85
hooks.tsFile · 0.85
useStreamFunction · 0.85
assertReactImportFunction · 0.85
injectToStreamFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…