MCPcopy
hub / github.com/mswjs/msw / invariant

Function invariant

cli/invariant.js:3–9  ·  view source on GitHub ↗
(predicate, message, ...args)

Source from the content-addressed store, hash-verified

1import colors from 'picocolors'
2
3export function invariant(predicate, message, ...args) {
4 if (!predicate) {
5 // eslint-disable-next-line no-console
6 console.error(colors.red(message), ...args)
7 process.exit(1)
8 }
9}

Callers 15

initFunction · 0.90
copyWorkerScriptFunction · 0.90
getLibraryTarballFunction · 0.85
getDevServerUrlFunction · 0.85
vitest.config.tsFile · 0.85
setupFunction · 0.85
urlMethod · 0.85
setupWorkerFunction · 0.85
constructorMethod · 0.85
postMessageMethod · 0.85
constructorMethod · 0.85
#printStartMessageMethod · 0.85

Calls 1

errorMethod · 0.45

Tested by 1

getDevServerUrlFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…