n8n/packages/editor-ui/src/utils/assert.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
191 B
TypeScript
Raw Normal View History

/**
* Asserts given condition
*/
export function assert(condition: unknown, message?: string): asserts condition {
if (!condition) {
throw new Error(message ?? 'Assertion failed');
}
}