Files
med-notes/.pnpm-store/v10/files/d6/f5d8621b96ea4ec72f70d4a08058fe57ea7a69db4780b86757f58a21f522083d22778a98e40b6e0903cec3a1986d613227940137093c3e3b8e356e0e80e5bc
2025-05-09 05:30:08 +02:00

22 lines
524 B
Plaintext

/**
* @fileoverview Assertion utilities equivalent to the Node.js node:asserts module.
* @author Josh Goldberg
*/
"use strict";
/**
* Throws an error if the input is not truthy.
* @param {unknown} value The input that is checked for being truthy.
* @param {string} message Message to throw if the input is not truthy.
* @returns {void}
* @throws {Error} When the condition is not truthy.
*/
function ok(value, message = "Assertion failed.") {
if (!value) {
throw new Error(message);
}
}
module.exports = ok;