*/
export function assert(
messageOrError: string | Error = 'unexpected state',
): asserts condition {
if (!condition) {
// if error instance is provided, use it, otherwise create a new one
const errorToThrow = typeof messageOrError === 'string'