Abstract
Returns value when Some, throws error otherwise.
Error message.
opt(null).orCrash('unexpected empty value') // crashes with Error('unexpected empty value')opt(1).orCrash('unexpected empty value') // 1opt(null).orCrash(() => new CustomException()) // crashes with CustomException
orCrash
Returns value when Some, throws error otherwise.