@nozbe/watermelondb
Version:
Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast
14 lines (10 loc) • 354 B
JavaScript
// @flow
import diagnosticError from '../diagnosticError'
// If `condition` is falsy, throws an Error with the passed message
export default function invariant(condition: any, errorMessage?: string): void {
if (!condition) {
const error: any = diagnosticError(errorMessage || 'Broken invariant')
error.framesToPop += 1
throw error
}
}