/** * Throws an error if the condition is false * @param condition * @param message * @param ErrorConstruct */ export const assert = ( condition: boolean | number | string | null | undefined, message: string, ErrorConstruct = Error ) => { if (!condition) { throw new ErrorConstruct(message) } }