@praha/byethrow
    Preparing search index...

    Function isSuccess

    • Type guard to check if a Result is a Success.

      Type Parameters

      • T

        The type of the success value.

      Parameters

      Returns result is Success<T>

      true if the result is a Success, otherwise false.

      import { Result } from '@praha/byethrow';

      const result: Result.Result<number, string> = { type: 'Success', value: 10 };
      if (Result.isSuccess(result)) {
      console.log(result.value); // Safe access to value
      }