UNPKG

ccxt

Version:

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges

16 lines (13 loc) 462 B
'use strict'; /** * Asserts that the given condition is true, otherwise throws an error with an optional message. * @param {any} condition - The condition to check. * @param {string} [message] - The optional message to include in the error. * @throws {Error} Throws an error if the condition is false. */ function assert(condition, message) { if (!condition) { throw new Error(message || 'Assertion failure'); } } module.exports = assert;