n8n/packages/@n8n/utils/src/assert.ts
Matsu 3454df1c1b
chore: Remove dead ESLint config and add lint parity tooling (no-changelog) (#38343)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 13:33:07 +03:00

9 lines
191 B
TypeScript

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