some<T> static method

T some<T>(
  1. Option<T> option, {
  2. String? reason,
})

Asserts option is Some and returns its value.

Implementation

static T some<T>(Option<T> option, {String? reason}) => option.match(
  some: (T value) => value,
  none: () =>
      throw AuthAssertionError(reason ?? 'expected Some but got None'),
);