export class AssertionFailureError extends Error { constructor ( msg ? ) { super ( 'Assertion failed' + msg ? ( ' ' + msg ) : '' ) ; } } export default function assert ( condition , msg ? ) { if ( ! condition ) { throw new AssertionFailureError ( msg ) ; } }