Template base para proyectos SaaS multi-tenant. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React/Vite) - apps/database (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
464 B
JavaScript
18 lines
464 B
JavaScript
/**
|
|
* @fileoverview Assertion utilities.
|
|
* @author Nicholas C. Zakas
|
|
*/
|
|
|
|
/**
|
|
* Throws an error if the given condition is not truthy.
|
|
* @param {boolean} condition The condition to check.
|
|
* @param {string} message The message to include with the error.
|
|
* @returns {void}
|
|
* @throws {Error} When the condition is not truthy.
|
|
*/
|
|
export function assert(condition, message = "Assertion failed.") {
|
|
if (!condition) {
|
|
throw new Error(message);
|
|
}
|
|
}
|