UNPKG

@ryusei/light

Version:

<div align="center"> <a href="https://light.ryuseijs.com"> <img alt="RyuseiLight" src="https://light.ryuseijs.com/images/svg/logo.svg" width="70"> </a>

12 lines (11 loc) 299 B
/** * Throws an error if the provided condition is falsy. * * @param condition - If falsy, an error is thrown. * @param message - Optional. A message for the error. */ export function assert( condition: any, message = '' ): void { if ( ! condition ) { throw new Error( message ); } }