MCPcopy Index your code
hub / github.com/formatjs/formatjs / invariant

Function invariant

packages/react-intl/utils.tsx:7–15  ·  view source on GitHub ↗
(
  condition: boolean,
  message: string,
  Err: any = Error
)

Source from the content-addressed store, hash-verified

5import {DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG} from '@formatjs/intl'
6
7export function invariant(
8 condition: boolean,
9 message: string,
10 Err: any = Error
11): asserts condition {
12 if (!condition) {
13 throw new Err(message)
14 }
15}
16
17export function invariantIntlContext(intl?: any): asserts intl {
18 invariant(

Callers 2

invariantIntlContextFunction · 0.70
FormattedRelativeTimeFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected