mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-31 08:46:58 +02:00
10 lines
253 B
TypeScript
10 lines
253 B
TypeScript
/**
|
|
* Asserts given condition
|
|
*/
|
|
export function assert(condition: unknown, message?: string): asserts condition {
|
|
if (!condition) {
|
|
// eslint-disable-next-line n8n-local-rules/no-plain-errors
|
|
throw new Error(message ?? 'Assertion failed');
|
|
}
|
|
}
|